Browse Source

Update PostgresSchemaTest.php

Add additional tests for Datetime format.
AJ Quick 9 years ago
parent
commit
b25f95e1f8
1 changed files with 12 additions and 2 deletions
  1. 12 2
      tests/TestCase/Database/Schema/PostgresSchemaTest.php

+ 12 - 2
tests/TestCase/Database/Schema/PostgresSchemaTest.php

@@ -781,7 +781,7 @@ SQL;
                 ['type' => 'boolean', 'default' => 1, 'null' => false],
                 '"checked" BOOLEAN NOT NULL DEFAULT TRUE'
             ],
-            // datetimes
+            // Datetime
             [
                 'created',
                 ['type' => 'datetime'],
@@ -792,6 +792,16 @@ SQL;
                 ['type' => 'datetime', 'null' => false, 'default' => '2016-12-07 23:04:00'],
                 '"open_date" TIMESTAMP NOT NULL DEFAULT \'2016-12-07 23:04:00\''
             ],
+            [
+                'null_date',
+                ['type' => 'datetime', 'null' => true],
+                '"null_date" TIMESTAMP NULL DEFAULT NULL'
+            ],
+            [
+                'current_timestamp',
+                ['type' => 'datetime', 'null' => false, 'default' => 'CURRENT_TIMESTAMP'],
+                '"current_timestamp" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP'
+            ],
             // Date & Time
             [
                 'start_date',
@@ -803,7 +813,7 @@ SQL;
                 ['type' => 'time'],
                 '"start_time" TIME'
             ],
-            // timestamps
+            // Timestamp
             [
                 'created',
                 ['type' => 'timestamp', 'null' => true],