diff options
author | Aldo "xoen" Giambelluca <xoen@xoen.org> | 2010-07-03 19:06:42 +0200 |
---|---|---|
committer | Aldo "xoen" Giambelluca <xoen@xoen.org> | 2010-07-03 19:06:42 +0200 |
commit | a87f4da3f3d176825faf3398a0e716f4577d385c (patch) | |
tree | 92c8ec374bd4018810671c9cd1d2988984054feb /inc/lib_config.php | |
parent | 969c8053cecf16c912bc496d3796ee63a8933367 (diff) | |
download | nextcloud-server-a87f4da3f3d176825faf3398a0e716f4577d385c.tar.gz nextcloud-server-a87f4da3f3d176825faf3398a0e716f4577d385c.zip |
Using table prefix preference and some reformatting
Diffstat (limited to 'inc/lib_config.php')
-rwxr-xr-x | inc/lib_config.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/inc/lib_config.php b/inc/lib_config.php index 986d12f4dce..546c393b7eb 100755 --- a/inc/lib_config.php +++ b/inc/lib_config.php @@ -134,6 +134,7 @@ class OC_CONFIG{ global $CONFIG_DBUSER; global $CONFIG_DBPASSWORD; global $CONFIG_DBTYPE; + global $CONFIG_DBTABLEPREFIX; global $CONFIG_ADMINLOGIN; global $CONFIG_ADMINPASSWORD; if(isset($_POST['set_config'])){ @@ -332,8 +333,15 @@ CREATE TABLE 'user_group' ( PRIMARY KEY ('user_group_id') ) "; - }elseif($CONFIG_DBTYPE=='mysql'){ - $query="CREATE TABLE IF NOT EXISTS `locks` ( + } elseif ( 'mysql' === $CONFIG_DBTYPE ) { + $dbTableLocks = $CONFIG_DBTABLEPREFIX . 'locks'; + $dbTableLog = $CONFIG_DBTABLEPREFIX . 'log'; + $dbTableProperties = $CONFIG_DBTABLEPREFIX . 'properties'; + $dbTableUsers = $CONFIG_DBTABLEPREFIX . 'users'; + $dbTableGroups = $CONFIG_DBTABLEPREFIX . 'groups'; + $dbTableUserGroup = $CONFIG_DBTABLEPREFIX . 'user_group'; + + $query = "CREATE TABLE IF NOT EXISTS `$dbTableLocks` ( `token` varchar(255) NOT NULL DEFAULT '', `path` varchar(200) NOT NULL DEFAULT '', `created` int(11) NOT NULL DEFAULT '0', @@ -351,7 +359,7 @@ PRIMARY KEY ('user_group_id') KEY `expires` (`expires`) ); -CREATE TABLE IF NOT EXISTS `log` ( +CREATE TABLE IF NOT EXISTS `$dbTableLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `timestamp` int(11) NOT NULL, `user` varchar(250) NOT NULL, @@ -361,7 +369,7 @@ CREATE TABLE IF NOT EXISTS `log` ( ); -CREATE TABLE IF NOT EXISTS `properties` ( +CREATE TABLE IF NOT EXISTS `$dbTableProperties` ( `path` varchar(255) NOT NULL DEFAULT '', `name` varchar(120) NOT NULL DEFAULT '', `ns` varchar(120) NOT NULL DEFAULT 'DAV:', @@ -370,7 +378,7 @@ CREATE TABLE IF NOT EXISTS `properties` ( KEY `path` (`path`) ); -CREATE TABLE IF NOT EXISTS `users` ( +CREATE TABLE IF NOT EXISTS `$dbTableUsers` ( `user_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `user_name` VARCHAR( 64 ) NOT NULL , `user_name_clean` VARCHAR( 64 ) NOT NULL , @@ -381,7 +389,7 @@ UNIQUE ( ) ); -CREATE TABLE IF NOT EXISTS `groups` ( +CREATE TABLE IF NOT EXISTS `$dbTableGroups` ( `group_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `group_name` VARCHAR( 64 ) NOT NULL , UNIQUE ( @@ -389,7 +397,7 @@ UNIQUE ( ) ); -CREATE TABLE IF NOT EXISTS `user_group` ( +CREATE TABLE IF NOT EXISTS `$dbTableUserGroup` ( `user_group_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `user_id` VARCHAR( 64 ) NOT NULL , `group_id` VARCHAR( 64 ) NOT NULL |