Skip to content

Commit

Permalink
CakePHP reads tinyint(1) as boolean. Changing it to tinyint(2) enable…
Browse files Browse the repository at this point in the history
…s you to put integers in there again. Closes #22
  • Loading branch information
Coen Coppens committed Sep 20, 2013
1 parent b7a6420 commit 9c5ac2d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
34 changes: 17 additions & 17 deletions Config/Schema/autotask-1.4.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ CREATE TABLE `dashboards` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`show_kill_rate` tinyint(1) NOT NULL DEFAULT '1',
`show_accounts` tinyint(1) NOT NULL DEFAULT '1',
`show_queues` tinyint(1) NOT NULL DEFAULT '1',
`show_resources` tinyint(1) NOT NULL DEFAULT '1',
`show_unassigned` tinyint(1) NOT NULL DEFAULT '1',
`show_missing_issue_type` tinyint(1) NOT NULL DEFAULT '1',
`show_rolling_week` tinyint(1) NOT NULL DEFAULT '1',
`show_rolling_week_bars` tinyint(1) NOT NULL,
`show_queue_health` tinyint(1) NOT NULL DEFAULT '1',
`show_sla_violations` tinyint(1) NOT NULL,
`show_tickets_top_x` tinyint(1) NOT NULL DEFAULT '0',
`show_clock` tinyint(1) NOT NULL DEFAULT '0',
`show_open_tickets` tinyint(1) NOT NULL DEFAULT '0',
`show_tickets_by_source` tinyint(1) NOT NULL DEFAULT '0',
`show_kill_rate` tinyint(2) NOT NULL DEFAULT '1',
`show_accounts` tinyint(2) NOT NULL DEFAULT '1',
`show_queues` tinyint(2) NOT NULL DEFAULT '1',
`show_resources` tinyint(2) NOT NULL DEFAULT '1',
`show_unassigned` tinyint(2) NOT NULL DEFAULT '1',
`show_missing_issue_type` tinyint(2) NOT NULL DEFAULT '1',
`show_rolling_week` tinyint(2) NOT NULL DEFAULT '1',
`show_rolling_week_bars` tinyint(2) NOT NULL,
`show_queue_health` tinyint(2) NOT NULL DEFAULT '1',
`show_sla_violations` tinyint(2) NOT NULL,
`show_tickets_top_x` tinyint(2) NOT NULL DEFAULT '0',
`show_clock` tinyint(2) NOT NULL DEFAULT '0',
`show_open_tickets` tinyint(2) NOT NULL DEFAULT '0',
`show_tickets_by_source` tinyint(2) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

Expand Down Expand Up @@ -216,8 +216,8 @@ CREATE TABLE `tickets` (
`subissuetype_id` int(10) DEFAULT NULL,
`due` datetime NOT NULL,
`priority` int(2) NOT NULL,
`has_met_sla` tinyint(1) NOT NULL DEFAULT '0',
`ticketsource_id` tinyint(1) NOT NULL DEFAULT '0',
`has_met_sla` tinyint(2) NOT NULL DEFAULT '0',
`ticketsource_id` tinyint(2) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

Expand Down Expand Up @@ -254,7 +254,7 @@ CREATE TABLE `timeentries` (
`ticket_id` int(10) NOT NULL,
`hours_to_bill` double(10,2) NOT NULL,
`hours_worked` double(10,2) NOT NULL,
`non_billable` tinyint(1) NOT NULL,
`non_billable` tinyint(2) NOT NULL,
`offset_hours` double(10,2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand Down
18 changes: 15 additions & 3 deletions Config/Schema/upgrade-1.3.2-to-1.4.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `dashboards`
-- ----------------------------
ALTER TABLE `dashboards` ADD COLUMN `show_open_tickets` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` ADD COLUMN `show_tickets_by_source` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` MODIFY `show_kill_rate` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_accounts` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_queues` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_resources` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_unassigned` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_missing_issue_type` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_rolling_week` tinyint(2) NOT NULL DEFAULT '1';
ALTER TABLE `dashboards` MODIFY `show_rolling_week_bars` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` MODIFY `show_queue_health` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` MODIFY `show_sla_violations` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` MODIFY `show_tickets_top_x` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` MODIFY `show_clock` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` ADD COLUMN `show_open_tickets` tinyint(2) NOT NULL DEFAULT '0';
ALTER TABLE `dashboards` ADD COLUMN `show_tickets_by_source` tinyint(2) NOT NULL DEFAULT '0';

-- ----------------------------
-- Table structure for `tickets`
-- ----------------------------
ALTER TABLE `tickets` ADD COLUMN `ticketsource_id` int(10) NOT NULL after `queue_id`;

-- ----------------------------
-- Table structure for `ticketsources`
-- ----------------------------
Expand Down

0 comments on commit 9c5ac2d

Please sign in to comment.