Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit d646917

Browse files
author
Michael Grauer
committed
BUG: refs #0326. called setupDatabase on default dataset for pgsql.
If you load rows from the default.xml dataset, and then try to programmatically create an object of the same type, in postgres an exception will be thrown because the mechanism for loading from default.xml does not update the sequence values in postgres (because the default.xml already supplies ids), so when you next try to create an object of the same type, postgres gives you the next sequence value as your id, which is in conflict with a row in the db. The way around this is to update the sequence value with the current max id, and this will occur when you call setupDatabase for the dataset in question.
1 parent e42de87 commit d646917

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/tests/models/base/FolderModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class FolderModelTest extends DatabaseTestCase
1515
/** init test*/
1616
public function setUp()
1717
{
18-
$this->setupDatabase(array());
18+
$this->setupDatabase(array('default'));
1919
$this->_models = array(
2020
'Folder', "Community", "Item", "Folderpolicyuser"
2121
);

0 commit comments

Comments
 (0)