zend-db
zend-db copied to clipboard
DDL improves
Hello, guys I want to add column with options such as AUTO INCREMENT and unsigned. How it do? Finally I've created follow class and add Constraint
`class AutoIncrement extends AbstractConstraint
{ /** * @var string */ protected $specification = 'AUTO_INCREMENT'; }`
Which is better way for creating table with DDL abstraction?
MySQL DDL already supports auto_increment keyword.
$column->setOption('AUTO_INCREMENT', true);
In general, current API adds column options not by extending constraints, but adding it to a list of keywords for syntax generator in appropriate engine decorator, eg https://github.com/zendframework/zend-db/blob/405e301f877e1b34ccdf5ed71294949000789a40/src/Sql/Platform/Mysql/Ddl/AlterTableDecorator.php#L105
This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at https://github.com/laminas/laminas-db/issues/73.