Skip to content
Permalink
Browse files

Fix issues with postgres.

Enabling constraints in postgres after dropping tables makes postgres
grumpy. It seems to work much better without the enable foreign keys
call. Foreign keys will be re-disabled, and then enabled on the
subsequent test method that inserts fixtures.
  • Loading branch information...
markstory committed Sep 6, 2014
1 parent 4746435 commit 197c4794141e281cb17b710261933c445f411d64
@@ -332,7 +332,6 @@ public function shutDown() {
$fixture->drop($db);
}
}
$db->enableForeignKeys();
});
}
}
@@ -31,7 +31,12 @@ class ArticlesTagFixture extends TestFixture {
'article_id' => ['type' => 'integer', 'null' => false],
'tag_id' => ['type' => 'integer', 'null' => false],
'_constraints' => [
'UNIQUE_TAG2' => ['type' => 'primary', 'columns' => ['article_id', 'tag_id']]
'unique_tag' => ['type' => 'primary', 'columns' => ['article_id', 'tag_id']],
'tag_idx' => [
'type' => 'foreign',
'columns' => ['tag_id'],
'references' => ['tags', 'id']
]
]
);
@@ -29,7 +29,7 @@ class OrmCacheShellTest extends TestCase {
*
* @var array
*/
public $fixtures = ['core.article', 'core.tag'];
public $fixtures = ['core.article', 'core.articles_tag', 'core.tag'];
/**
* setup method

0 comments on commit 197c479

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