X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/6cb9c41aae566dcc564fa8ad3a6c6ee4facdf373..a2cf5ce7f9c827da299ef19e3fa56030f8cdbf79:/mysql.sql?ds=sidebyside

diff --git a/mysql.sql b/mysql.sql
index c37a32c4..9d690111 100644
--- a/mysql.sql
+++ b/mysql.sql
@@ -409,6 +409,10 @@ CREATE TABLE `tt_roles` (
 # Create an index that guarantees unique active and inactive role ranks in each group.
 create unique index role_idx on tt_roles(team_id, rank, status);
 
+# Insert site-wide roles - site administrator and top manager.
+INSERT INTO `tt_roles` (`team_id`, `name`, `rank`, `rights`) VALUES (0, 'Site administrator', 1024, 'administer_site');
+INSERT INTO `tt_roles` (`team_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'data_entry,view_own_data,manage_own_settings,view_users,on_behalf_data_entry,view_data,override_punch_mode,swap_roles,approve_timesheets,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,manage_features,manage_basic_settings,manage_advanced_settings,manage_roles,export_data,manage_subgroups');
+# TODO: move this code above, create roles before creating admin account and assign admin account its role.
 
 #
 # Structure for table tt_site_config. This table stores configuration data
@@ -416,11 +420,11 @@ create unique index role_idx on tt_roles(team_id, rank, status);
 # For example, database version, code version, site language, etc.
 #
 CREATE TABLE `tt_site_config` (
-  `param_name` varchar(32) NOT NULL,              # parameter name
-  `param_value` text default NULL,                # parameter value
-  `created` datetime default CURRENT_TIMESTAMP,   # creation time
-  `updated` datetime ON UPDATE CURRENT_TIMESTAMP, # modification time
+  `param_name` varchar(32) NOT NULL, # parameter name
+  `param_value` text default NULL,   # parameter value
+  `created` datetime default NULL,   # creation time
+  `updated` datetime default NULL,   # modification time
   PRIMARY KEY  (`param_name`)
 );
 
-INSERT INTO `tt_site_config` (`param_name`, `param_value`) VALUES ('version_db', '1.17.34'); # TODO: change when structure changes.
+INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.35', now()); # TODO: change when structure changes.
