8000 Corrected duplicate 'COMMENT' part in DDL statement by mondrake · Pull Request #2730 · doctrine/dbal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Corrected duplicate 'COMMENT' part in DDL statement #2730

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

Closed
wants to merge 2 commits into from
Closed

Corrected duplicate 'COMMENT' part in DDL statement #2730

wants to merge 2 commits into from

Conversation

mondrake
Copy link
Contributor

If you pass both a 'columnDefinition' containing a comment, and a 'comment' option, to a column when creating /altering a table, the SQL statement produced by the schema has a duplicate COMMENT part.

The following code

  $table = new Table('my_table');
  $table->addColumn('id', 'integer', array(
    'columnDefinition' => 'INT DEFAULT 0 NOT NULL COMMENT \'expected+column+comment\'', 
    'comment' => 'unexpected_column_comment')
  );
  $sql = $this->_conn->getDatabasePlatform()->getCreateTableSQL($table);

will generate:

CREATE TABLE my_table 
(id INT DEFAULT 0 NOT NULL COMMENT 'expected+column+comment' COMMENT 'unexpected_column_comment') 
DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB

@mondrake
Copy link
Contributor Author

@Ocramius sorry for the mess on the other 2 PRs.

@mondrake mondrake changed the title Fix - Duplicate 'COMMENT' part in SQL statement Duplicate 'COMMENT' part in SQL statement May 16, 2017
Copy link
Contributor
@phansys phansys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status: Needs work.

$options = array(
'type' => Type::getType('integer'),
'default' => 0,
'notnull' => TRUE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use true instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phansys thanks, I'm used to Drupal CS which is just the opposite :(

@mondrake
Copy link
Contributor Author

Made changes requested.

8000
Copy link
Member
@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging at the soonest occasion, as I cannot backport from here

@Ocramius Ocramius modified the milestones: 2.5.13, 2.6 Jun 29, 2017
@Ocramius Ocramius closed this in e60a582 Jun 29, 2017
Ocramius added a commit that referenced this pull request Jun 29, 2017
@Ocramius
Copy link
Member

Merged, thanks @mondrake!

master: e60a582
2.5: 994f3b0

@mondrake mondrake deleted the fix-comment-2 branch June 30, 2017 06:03
@Ocramius Ocramius changed the title Duplicate 'COMMENT' part in SQL statement Corrected duplicate 'COMMENT' part in DDL statement Jul 22, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2022
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.

3 participants
0