Started to populate org_id on creation of expense items.
[timetracker.git] / mysql.sql
index 14a8aa0..5ffc79e 100644 (file)
--- a/mysql.sql
+++ b/mysql.sql
@@ -405,6 +405,7 @@ CREATE TABLE `tt_expense_items` (
   `date` date NOT NULL,                   # date the record is for
   `user_id` int(11) NOT NULL,             # user id the expense item is reported by
   `group_id` int(11) default NULL,        # group id
+  `org_id` int(11) default NULL,          # organization id
   `client_id` int(11) default NULL,       # client id
   `project_id` int(11) default NULL,      # project id
   `name` text NOT NULL,                   # expense item name (what is an expense for)
@@ -437,6 +438,7 @@ create index invoice_idx on tt_expense_items(invoice_id);
 CREATE TABLE `tt_predefined_expenses` (
   `id` int(11) NOT NULL auto_increment, # predefined expense id
   `group_id` int(11) NOT NULL,          # group id
+  `org_id` int(11) default NULL,        # organization id
   `name` varchar(255) NOT NULL,         # predefined expense name, such as mileage
   `cost` decimal(10,2) default '0.00',  # cost for one unit
   PRIMARY KEY  (`id`)
@@ -449,6 +451,7 @@ CREATE TABLE `tt_predefined_expenses` (
 #
 CREATE TABLE `tt_monthly_quotas` (
   `group_id` int(11) NOT NULL,            # group id
+  `org_id` int(11) default NULL,          # organization id
   `year` smallint(5) UNSIGNED NOT NULL,   # quota year
   `month` tinyint(3) UNSIGNED NOT NULL,   # quota month
   `minutes` int(11) default NULL,         # quota in minutes in specified month and year
@@ -469,4 +472,4 @@ CREATE TABLE `tt_site_config` (
   PRIMARY KEY  (`param_name`)
 );
 
-INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.14', now()); # TODO: change when structure changes.
+INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.17', now()); # TODO: change when structure changes.