summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorSerge Martin <edb@sigluy.net>2011-08-07 21:06:53 +0200
committerSerge Martin <edb@sigluy.net>2011-08-07 21:06:53 +0200
commit3e8ae8636cad91877c727c7b1ea77436816e7c3d (patch)
tree297fb9c5ab82a27d042bad7bc304f020f957a170 /lib/db.php
parentacf7916e71f1e290aa12eb259d92aa8ab2ffcf23 (diff)
downloadnextcloud-server-3e8ae8636cad91877c727c7b1ea77436816e7c3d.tar.gz
nextcloud-server-3e8ae8636cad91877c727c7b1ea77436816e7c3d.zip
Add postgresql support
REVIEW: 102101
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/db.php b/lib/db.php
index 9b18bc4c97f..76d3fe5efcb 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -237,6 +237,7 @@ class OC_DB {
public static function createDbFromStructure( $file ){
$CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );
$CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
+ $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
self::connectScheme();
@@ -247,6 +248,9 @@ class OC_DB {
$file2 = tempnam( sys_get_temp_dir(), 'oc_db_scheme_' );
$content = str_replace( '*dbname*', $CONFIG_DBNAME, $content );
$content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content );
+ if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite don't
+ $content = str_replace( '<default>0000-00-00 00:00:00</default>', '<default>CURRENT_TIMESTAMP</default>', $content );
+ }
file_put_contents( $file2, $content );
// Try to create tables