Skip to content
Permalink
Browse files

Add disable/enable constraints for SQLServer.

I have no verified this, but it looks like it will work.
  • Loading branch information...
markstory committed Sep 4, 2014
1 parent 30e0e8e commit f7868a7b3d7a92d944eb7eeada1061120c7af04c
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/Database/Dialect/SqlserverDialectTrait.php
@@ -237,12 +237,14 @@ public function newCompiler() {
* {@inheritDoc}
*/
public function disableForeignKeySQL() {
return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
}
/**
* {@inheritDoc}
*/
public function enableForeignKeySQL() {
return 'EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
}
}

0 comments on commit f7868a7

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