Permalink
Browse files

Adding failing test for postgres alter table.

Refs #1967
  • Loading branch information...
1 parent 77b3e63 commit c919b73f22012c514832a71f21c87f2de706624d @markstory markstory committed Sep 17, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
@@ -699,6 +699,22 @@ function testAlterSchema() {
$this->assertEqual($result['title']['null'], false);
$this->db->query($this->db->dropSchema($New));
+
+ $New =& new CakeSchema(array(
+ 'connection' => 'test_suite',
+ 'name' => 'AlterPosts',
+ 'alter_posts' => array(
+ 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'),
+ 'author_id' => array('type' => 'integer', 'null' => false),
+ 'title' => array('type' => 'string', 'null' => true),
+ 'body' => array('type' => 'text'),
+ 'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
+ 'created' => array('type' => 'datetime'),
+ 'updated' => array('type' => 'datetime'),
+ )
+ ));
+ $result = $this->db->alterSchema($New->compare($Old), 'alter_posts');
+ $this->assertNoPattern('/varchar\(36\) NOT NULL/i', $result);
}
/**

0 comments on commit c919b73

Please sign in to comment.