Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Db\Sql\Ddl Improvements #6257

Closed
wants to merge 37 commits into from
Closed

Zend\Db\Sql\Ddl Improvements #6257

wants to merge 37 commits into from

Conversation

kabel
Copy link

@kabel kabel commented May 13, 2014

  • Reduces code duplication in column classes using the inheritance chain and abstract classes
  • Adds API to allow Zend\Db\Sql\Ddl\Constraint classes to be added to columns
  • Adds some missing standard SQL data types
  • Refactor the MySQL CreateTableDecorator class to allow for inserting data type options and adding other column options in the correct position/order
  • Clean up some tests

Fixes #6210

Maks3w and others added 30 commits May 7, 2014 20:48
DDL expressions should not result in trailing whitespace.
Fixes missing DEFAULT value in expression data
Purposely ignore $isNullable from parent by resetting it in
getExpressionData()
* NOT NULL should be in the spec like DEFAULT
* Type is never in the spec (always second param)
* Float column should have FLOAT type
Should follow the same SQL92 named constrained syntax pattern
* Constraint doesn't need to use position placeholders
* Reference column should support an array of column identifiers
Provides an API for adding single column constraints to avoid adding a
separate, named constaint to the table
Splits the specification into two parts; the named part (for table
constraints), and the rest (the table/column constraints)
@kabel
Copy link
Author

kabel commented May 18, 2014

@jimmysole, if this is accepted, yes, it will allow you to create unsigned columns among other things:

$pkCol = new Zend\Db\Sql\Ddl\Column\Integer('foo', false, null, array('auto_increment' => true, 'unsigned' => true));
$pkCol->addConstraint(new Zend\Db\Sql\Ddl\Constraint\PrimaryKey());

@jimmysole
Copy link

@kabel That would be awesome! I hope it is accepted.

@weierophinney weierophinney added this to the 2.4.0 milestone Aug 6, 2014
@weierophinney
Copy link
Member

Scheduling for 2.4.0, as it adds significant functionality and changes internals.

@Ocramius
Copy link
Member

Adding the BC Break flag as there are internal breakages.

@Ocramius Ocramius self-assigned this Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
@Ocramius
Copy link
Member

Merged into develop in 4b34fba, thanks @kabel :-)

@Ocramius Ocramius closed this Nov 17, 2014
@mfairchild365
Copy link
Contributor

+1

adamlundrigan added a commit to adamlundrigan/zf2 that referenced this pull request Nov 18, 2014
@adamlundrigan
Copy link
Contributor

@Ocramius php-cs-fixer is now complaining about CS failures in:

  • library/Zend/Db/Sql/Ddl/Column/Integer.php (braces)
  • tests/Zend/Db/Sql/Ddl/Column/BinaryTest.php (braces)

I've PR'd what php-cs-fixer spit out over here: #6889

@Ocramius
Copy link
Member

@adamlundrigan already merged #6885 by @samsonasik about that :-) Thanks anyway!

@kabel kabel deleted the ddl-columns branch August 2, 2015 01:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants