laminas/laminas-db

DDL improves

Closed this issue · 2 comments

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?


Originally posted by @melnychukvitaliy at zendframework/zend-db#246

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


Originally posted by @alextech at zendframework/zend-db#246 (comment)

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend: