New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PostgreSQL] Change sequences naming to conform to SERIAL type #1906

Merged
merged 1 commit into from Feb 7, 2017

Conversation

3 participants
@alongosz
Member

alongosz commented Feb 6, 2017

This PR presents changes to 7.0 that are a BC break.

Our current sequence name is <table>_s, what we need is <table>_<column>_seq which conforms to SERIAL type in PostgreSQL.

Reasons:

  1. It simplifies database fixtures for the PostgreSQL. Instead of manually creating sequences we can rely on SERIAL type.
  2. It simplifies creating database in a generic way, using Doctrine\DBAL Schema representation tools.
    Consider the following simplified example:
$schema = new \Doctrine\DBAL\Schema\Schema();
$myTable = $schema->createTable('my_table');
$myTable->addColumn('id', 'integer', [
    'autoincrement' => true,
]);

This code will generate SQL: id SERIAL and id INT NOT NULL AUTO_INCREMENT for PostgreSQL and MySQL respectively.

TODO:

  • Change sequence name in PHP backend.
  • Change database fixtures used for tests.

@alongosz alongosz requested a review from Nattfarinn Feb 6, 2017

@andrerom andrerom merged commit b0bf551 into ezsystems:7.0 Feb 7, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
ezrobot Code review by ezrobot
Details

@andrerom andrerom referenced this pull request Feb 7, 2017

Merged

[WIP] 7.0 kernel branch #1875

1 of 3 tasks complete

andrerom added a commit that referenced this pull request Feb 7, 2017

@alongosz alongosz deleted the alongosz:7.0 branch Feb 13, 2017

andrerom added a commit that referenced this pull request Feb 14, 2017

andrerom added a commit that referenced this pull request Feb 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment