Skip to content
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

Changed work with foreign key and new unit tests #12937

Merged
merged 2 commits into from
Jul 4, 2017

Conversation

sergeysviridenko
Copy link
Contributor

@sergeysviridenko sergeysviridenko commented Jul 3, 2017

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines?
  • I have checked that another pull request for this purpose does not exist.
  • I wrote some tests for this PR.

Small description of change:

I've changed foreign key workflow: changed method addForeignKey() and added FOREIGN_KEY_CHECKS check.

Thanks

@@ -348,7 +348,11 @@ class Mysql extends Dialect
{
var sql, onDelete, onUpdate;

let sql = "ALTER TABLE " . this->prepareTable(tableName, schemaName) . " ADD FOREIGN KEY `" . reference->getName() . "`(" . this->getColumnList(reference->getColumns()) . ") REFERENCES " . this->prepareTable(reference->getReferencedTable(), reference->getReferencedSchema()) . "(" . this->getColumnList(reference->getReferencedColumns()) . ")";
let sql = "ALTER TABLE " . this->prepareTable(tableName, schemaName) . " ADD";
if (reference->getName()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (reference->getName()) { => if reference->getName() {

@sergeyklay sergeyklay added this to the unplanned milestone Jul 3, 2017
@sergeysviridenko sergeysviridenko force-pushed the 3.2.foreign_key branch 5 times, most recently from 27ff006 to f0d0869 Compare July 4, 2017 12:26
@sergeyklay sergeyklay merged commit 735753e into phalcon:3.2.x Jul 4, 2017
@sergeyklay
Copy link
Contributor

Thank you

@sergeyklay sergeyklay mentioned this pull request Jul 4, 2017
3 tasks
@sergeysviridenko sergeysviridenko deleted the 3.2.foreign_key branch July 5, 2017 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants