]> git.nbdom.net Git - nb.git/commitdiff
pgsql create
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Mon, 20 Jun 2016 14:43:59 +0000 (15:43 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Mon, 20 Jun 2016 14:43:59 +0000 (15:43 +0100)
lib/php/db/types/pgsql.php

index 37b12b30864fb1ba18be011d505eac6c09747bea..bd3221c0f61923901e3f14eb35bf46d07a77f2fb 100644 (file)
@@ -6,6 +6,13 @@ $DB_TYPES['pgsql'] = array (
 
 'tables' => 'SELECT table_name as name,LOWER(CASE table_type WHEN \'BASE TABLE\' THEN \'TABLE\' ELSE table_type END) as type,table_type FROM information_schema.tables WHERE table_type in(\'BASE TABLE\',\'VIEW\') AND table_schema NOT IN (\'pg_catalog\', \'information_schema\')',
 
+'create' => function(&$field) {
+  $r = array(
+    '/datetime/i' => 'timestamp',
+  );
+  $field->type = preg_replace(array_keys($r),array_values($r),$field->type);
+},
+
 'table.sql' => 'SELECT CASE c.relkind::char WHEN \'r\' THEN (
 SELECT
   \'CREATE TABLE \'||sql.table||\'(