Skip to content
Permalink
Browse files

Add SQL commands to disable constraints to MySQL and SQLite.

Postgres and SQLserver don't seem quite so simple.
  • Loading branch information...
markstory committed Sep 4, 2014
1 parent 5de8eee commit f7c2b5957e9645f4d62eaae5c16e835d67c1af5f
Showing with 4 additions and 0 deletions.
  1. +2 −0 src/Database/Dialect/MysqlDialectTrait.php
  2. +2 −0 src/Database/Dialect/SqliteDialectTrait.php
@@ -66,12 +66,14 @@ public function schemaDialect() {
* {@inheritDoc}
*/
public function disableForeignKeySQL() {
return 'SET foreign_key_checks = 0';
}
/**
* {@inheritDoc}
*/
public function enableForeignKeySQL() {
return 'SET foreign_key_checks = 1';
}
}
@@ -163,12 +163,14 @@ public function schemaDialect() {
* {@inheritDoc}
*/
public function disableForeignKeySQL() {
return 'PRAGMA foreign_keys = OFF';
}
/**
* {@inheritDoc}
*/
public function enableForeignKeySQL() {
return 'PRAGMA foreign_keys = ON';
}
}

0 comments on commit f7c2b59

Please sign in to comment.
You can’t perform that action at this time.