mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
working on setup program
This commit is contained in:
parent
9e1c56b5e2
commit
1fdc0b03f6
@ -18,7 +18,7 @@
|
||||
UNIQUE config_name (config_name)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE applications (
|
||||
@ -30,7 +30,7 @@
|
||||
UNIQUE app_name (app_name)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE accounts (
|
||||
@ -49,7 +49,7 @@
|
||||
UNIQUE account_lid (account_lid)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
create table groups (
|
||||
@ -59,7 +59,7 @@
|
||||
primary key(group_id)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE preferences (
|
||||
@ -69,7 +69,7 @@
|
||||
preference_appname varchar(50)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE sessions (
|
||||
@ -82,7 +82,7 @@
|
||||
UNIQUE sessionid (session_id)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE app_sessions (
|
||||
@ -92,7 +92,7 @@
|
||||
content text
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
create table access_log (
|
||||
@ -103,7 +103,7 @@
|
||||
lo int
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE profiles (
|
||||
@ -117,7 +117,7 @@
|
||||
PRIMARY KEY (con)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE addressbook (
|
||||
@ -143,7 +143,7 @@
|
||||
PRIMARY KEY (ab_id)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE todo (
|
||||
@ -158,7 +158,7 @@
|
||||
PRIMARY KEY (todo_id)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE webcal_entry (
|
||||
@ -178,7 +178,7 @@
|
||||
PRIMARY KEY (cal_id)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE webcal_entry_repeats (
|
||||
@ -189,7 +189,7 @@
|
||||
cal_days char(7)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE webcal_entry_user (
|
||||
@ -199,7 +199,7 @@
|
||||
PRIMARY KEY (cal_id, cal_login)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
create table webcal_entry_groups (
|
||||
@ -207,7 +207,7 @@
|
||||
groups varchar(255)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE newsgroups (
|
||||
@ -221,7 +221,7 @@
|
||||
UNIQUE name (name)
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE users_newsgroups (
|
||||
@ -229,7 +229,7 @@
|
||||
newsgroup int(11) NOT NULL
|
||||
)";
|
||||
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE lang (
|
||||
@ -239,5 +239,5 @@
|
||||
content text NOT NULL,
|
||||
PRIMARY KEY (message_id,app_name,lang)
|
||||
)";
|
||||
$db->query('insert into config (config_name, config_value) values ('default_tplset', 'default')";
|
||||
$db->query($sql)";
|
||||
?>
|
32
setup/droptables_mysql.inc.php
Normal file
32
setup/droptables_mysql.inc.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or");at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$db->query("DROP TABLE config");
|
||||
$db->query("DROP TABLE applications");
|
||||
$db->query("DROP TABLE accounts");
|
||||
$db->query("DROP TABLE groups");
|
||||
$db->query("DROP TABLE preferences");
|
||||
$db->query("DROP TABLE sessions");
|
||||
$db->query("DROP TABLE app_sessions");
|
||||
$db->query("DROP TABLE access_log");
|
||||
$db->query("DROP TABLE profiles");
|
||||
$db->query("DROP TABLE addressbook");
|
||||
$db->query("DROP TABLE todo");
|
||||
$db->query("DROP TABLE webcal_entry");
|
||||
$db->query("DROP TABLE webcal_entry_repeats");
|
||||
$db->query("DROP TABLE webcal_entry_user");
|
||||
$db->query("DROP TABLE webcal_entry_groups");
|
||||
$db->query("DROP TABLE newsgroups");
|
||||
$db->query("DROP TABLE users_newsgroups");
|
||||
$db->query("DROP TABLE lang");
|
||||
?>
|
@ -39,15 +39,18 @@
|
||||
if ($db->num_rows() == 0){
|
||||
$db->query("select * from accounts");
|
||||
if ($db->num_rows() == 0){
|
||||
echo "You appear to be running a new install of phpGroupWare<br>\n";
|
||||
echo "You appear to be running a new install of phpGroupWare, so the tables will be created for you.<br>\n";
|
||||
include ("createtables_"$phpgw_info["server"]["db_type"].".inc.php");
|
||||
include ("default_records.inc.php");
|
||||
echo "If you did not recieve any errors, your tables have been created.<br>\n";
|
||||
echo "<a href="config.php">Click here</a> to configure the environment.<br>\n";
|
||||
}else{
|
||||
echo "You appear to be running a pre-beta version of phpGroupWare<br>\n";
|
||||
echo "We are not providing an upgrade path at this time, please backup your tables and drop them, so that this script can recreate them.<br>\n";
|
||||
}
|
||||
}else{
|
||||
echo "Your database seems to be current. Would you like to configure the environment now?<br>\n";
|
||||
echo "Your database seems to be current.<br>\n";
|
||||
echo "<a href="config.php">Click here</a> to configure the environment.<br>\n";
|
||||
}
|
||||
|
||||
include ("createtables_mysql.inc.php");
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user