I have a custom table. Using the InstallSchema, I was able to add default values using:
)->addColumn(
'created_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE],
'Updated At'
How can i achieve the same thing using the db schema xml file? :
<table comment="my table comment" engine="innodb" name="my_table_name" resource="default">
......
<column name="created_at" nullable="false" xsi:type="datetime"/>
<column name="updated_at" nullable="true" xsi:type="datetime"/>
</table>