From 906a1419413d0ed8f5e335f10cf1b86161676a55 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 20 Jun 2016 15:43:59 +0100 Subject: [PATCH] pgsql create --- lib/php/db/types/pgsql.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/php/db/types/pgsql.php b/lib/php/db/types/pgsql.php index 37b12b30..bd3221c0 100644 --- a/lib/php/db/types/pgsql.php +++ b/lib/php/db/types/pgsql.php @@ -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||\'( -- 2.47.3