X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/8f7f616dc5fafe49038c6eaff25f6fe6f55ca635..ab284f0e5be219f5560844cfc5e4c0a48ba1142a:/dbinstall.php
diff --git a/dbinstall.php b/dbinstall.php
index 58467bc1..7f87d7b7 100755
--- a/dbinstall.php
+++ b/dbinstall.php
@@ -61,7 +61,7 @@ if ($request->isGet()) {
// spit white space before output in some situations such as in PDF reports.
$file = fopen(APP_DIR.'/WEB-INF/config.php', 'r');
$line = fgets($file);
- if (strcmp('Error: WEB-INF/config.php file does not start with PHP opening tag.
');
}
fclose($file);
@@ -709,7 +709,7 @@ if ($_POST) {
setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`");
}
- if ($_POST["convert11400to11714"]) {
+ if ($_POST["convert11400to11734"]) {
setChange("ALTER TABLE `tt_teams` DROP `address`");
setChange("ALTER TABLE `tt_fav_reports` ADD `report_spec` text default NULL AFTER `user_id`");
setChange("ALTER TABLE `tt_fav_reports` ADD `paid_status` tinyint(4) default NULL AFTER `invoice`");
@@ -720,6 +720,21 @@ if ($_POST) {
setChange("ALTER TABLE `tt_teams` ADD `config` text default NULL AFTER `custom_logo`");
setChange("ALTER TABLE `tt_monthly_quotas` ADD `minutes` int(11) DEFAULT NULL");
setChange("ALTER TABLE `tt_teams` ADD `workday_minutes` smallint(4) DEFAULT '480' AFTER `workday_hours`");
+ setChange("UPDATE `tt_teams` SET `workday_minutes` = 60 * `workday_hours`");
+ setChange("ALTER TABLE `tt_teams` DROP `workday_hours`");
+ setChange("UPDATE `tt_monthly_quotas` SET `minutes` = 60 * `quota`");
+ setChange("ALTER TABLE `tt_monthly_quotas` DROP `quota`");
+ setChange("ALTER TABLE `tt_teams` DROP `uncompleted_indicators`");
+ setChange("ALTER TABLE `tt_users` MODIFY `timestamp` timestamp default CURRENT_TIMESTAMP");
+ setChange("ALTER TABLE `tt_teams` MODIFY `timestamp` timestamp default CURRENT_TIMESTAMP");
+ setChange("ALTER TABLE `tt_log` MODIFY `timestamp` timestamp default CURRENT_TIMESTAMP");
+ setChange("ALTER TABLE `tt_tmp_refs` MODIFY `timestamp` timestamp default CURRENT_TIMESTAMP");
+ setChange("CREATE TABLE `tt_roles` (`id` int(11) NOT NULL auto_increment, `team_id` int(11) NOT NULL, `name` varchar(80) default NULL, `rank` int(11) default 0, `rights` text default NULL, `status` tinyint(4) default 1, PRIMARY KEY (`id`))");
+ setChange("create unique index role_idx on tt_roles(team_id, rank, status)");
+ setChange("ALTER TABLE `tt_roles` ADD `description` varchar(255) default NULL AFTER `name`");
+ setChange("ALTER TABLE `tt_users` ADD `role_id` int(11) default NULL AFTER `role`");
+ setChange("CREATE TABLE `tt_site_config` (`param_name` varchar(32) NOT NULL, `param_value` text default NULL, `created` datetime default NULL, `updated` datetime default NULL, PRIMARY KEY (`param_name`))");
+ setChange("INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.34', now())");
}
if ($_POST["cleanup"]) {
@@ -752,6 +767,7 @@ if ($_POST) {
setChange("OPTIMIZE TABLE tt_tmp_refs");
setChange("OPTIMIZE TABLE tt_user_project_binds");
setChange("OPTIMIZE TABLE tt_users");
+ setChange("OPTIMIZE TABLE tt_roles");
}
print "done.
\n";
@@ -764,7 +780,7 @@ if ($_POST) {
| Create database structure (v1.17.14) + | Create database structure (v1.17.34)
(applies only to new installations, do not execute when updating) |