is there any way to create 2 auto increment id in same table?When im trying to create using db_schema, error showing that only primary key id can get this auto increment.is there any other ways?
1 Answer
try below code
<table name="declarative_table">
<column xsi:type="int" name="id_column1" padding="10" unsigned="true" nullable="false" comment="Entity Id"/>
<column xsi:type="int" name="id_column2" padding="10" unsigned="true" nullable="false" comment="Entity Id"/>
<column xsi:type="int" name="severity" padding="10" unsigned="true" nullable="false" comment="Severity code"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="timestamp" name="time_occurred" comment="Time of event"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id_column1"/>
<column name="id_column2"/>
</constraint>
</table>
it's working fine. check the screenshot