From 748d7ea037ca1857977c825cbee25b61ff0c5ea7 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 22 Oct 2010 15:18:56 +0000 Subject: #927828 by Damien Tournoud, LaurentAjdnik, boombatower: Fixed contrib can't specify custom schema types. Should fix Date module. Yay. --- modules/simpletest/tests/schema.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test index 8c6fa7f46..7570ab9d8 100644 --- a/modules/simpletest/tests/schema.test +++ b/modules/simpletest/tests/schema.test @@ -112,6 +112,25 @@ class SchemaTestCase extends DrupalWebTestCase { $count = db_query('SELECT COUNT(*) FROM {test_table}')->fetchField(); $this->assertEqual($count, 2, t('There were two rows.')); + + // Use database specific data type and ensure that table is created. + $table_specification = array( + 'description' => 'Schema table description.', + 'fields' => array( + 'timestamp' => array( + 'mysql_type' => 'timestamp', + 'pgsql_type' => 'timestamp', + 'sqlite_type' => 'datetime', + 'not null' => FALSE, + 'default' => NULL, + ), + ), + ); + try { + db_create_table('test_timestamp', $table_specification); + } + catch (Exception $e) {} + $this->assertTrue(db_table_exists('test_timestamp'), t('Table with database specific datatype was created.')); } function tryInsert($table = 'test_table') { -- cgit v1.2.3