Skip to content
This repository
Browse code

Adding failing test for postgres alter table.

Refs #1967
  • Loading branch information...
commit c919b73f22012c514832a71f21c87f2de706624d 1 parent 77b3e63
Mark Story authored September 16, 2011
16  cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
@@ -699,6 +699,22 @@ function testAlterSchema() {
699 699
 		$this->assertEqual($result['title']['null'], false);
700 700
 
701 701
 		$this->db->query($this->db->dropSchema($New));
  702
+
  703
+		$New =& new CakeSchema(array(
  704
+			'connection' => 'test_suite',
  705
+			'name' => 'AlterPosts',
  706
+			'alter_posts' => array(
  707
+				'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'),
  708
+				'author_id' => array('type' => 'integer', 'null' => false),
  709
+				'title' => array('type' => 'string', 'null' => true),
  710
+				'body' => array('type' => 'text'),
  711
+				'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
  712
+				'created' => array('type' => 'datetime'),
  713
+				'updated' => array('type' => 'datetime'),
  714
+			)
  715
+		));
  716
+		$result = $this->db->alterSchema($New->compare($Old), 'alter_posts');
  717
+		$this->assertNoPattern('/varchar\(36\) NOT NULL/i', $result);
702 718
 	}
703 719
 
704 720
 /**

0 notes on commit c919b73

Please sign in to comment.
Something went wrong with that request. Please try again.