Browse Source

Include DB upgrades through 17.03.17 in base pkg

Alan Hardman 2 years ago
parent
commit
f7c9b28c2a
2 changed files with 60 additions and 58 deletions
  1. 52 56
      db/17.03.17.sql
  2. 8 2
      db/database.sql

+ 52 - 56
db/17.03.17.sql

@@ -1,58 +1,54 @@
-ALTER TABLE issue
- ADD size_estimate VARCHAR(20) AFTER name;
- 
- ALTER ALGORITHM = UNDEFINED DEFINER = `root` @`localhost` SQL SECURITY DEFINER VIEW `issue_detail`
-AS
-   (SELECT `issue`.`id`               AS `id`,
-           `issue`.`status`           AS `status`,
-           `issue`.`type_id`          AS `type_id`,
-           `issue`.`name`             AS `name`,
-           `issue`.`size_estimate`    AS `size_estimate`,
-           `issue`.`description`      AS `description`,
-           `issue`.`parent_id`        AS `parent_id`,
-           `issue`.`author_id`        AS `author_id`,
-           `issue`.`owner_id`         AS `owner_id`,
-           `issue`.`priority`         AS `priority`,
-           `issue`.`hours_total`      AS `hours_total`,
-           `issue`.`hours_remaining`  AS `hours_remaining`,
-           `issue`.`hours_spent`      AS `hours_spent`,
-           `issue`.`created_date`     AS `created_date`,
-           `issue`.`closed_date`      AS `closed_date`,
-           `issue`.`deleted_date`     AS `deleted_date`,
-           `issue`.`start_date`       AS `start_date`,
-           `issue`.`due_date`         AS `due_date`,
-           isnull(`issue`.`due_date`) AS `has_due_date`,
-           `issue`.`repeat_cycle`     AS `repeat_cycle`,
-           `issue`.`sprint_id`        AS `sprint_id`,
-           `issue`.`due_date_sprint`  AS `due_date_sprint`,
-           `sprint`.`name`            AS `sprint_name`,
-           `sprint`.`start_date`      AS `sprint_start_date`,
-           `sprint`.`end_date`        AS `sprint_end_date`,
-           `type`.`name`              AS `type_name`,
-           `status`.`name`            AS `status_name`,
-           `status`.`closed`          AS `status_closed`,
-           `priority`.`id`            AS `priority_id`,
-           `priority`.`name`          AS `priority_name`,
-           `author`.`username`        AS `author_username`,
-           `author`.`name`            AS `author_name`,
-           `author`.`email`           AS `author_email`,
-           `author`.`task_color`      AS `author_task_color`,
-           `owner`.`username`         AS `owner_username`,
-           `owner`.`name`             AS `owner_name`,
-           `owner`.`email`            AS `owner_email`,
-           `owner`.`task_color`       AS `owner_task_color`
-    FROM ((((((`issue`
-               LEFT JOIN `user` `author`
-                  ON ((`issue`.`author_id` = `author`.`id`)))
-              LEFT JOIN `user` `owner`
-                 ON ((`issue`.`owner_id` = `owner`.`id`)))
-             LEFT JOIN `issue_status` `status`
-                ON ((`issue`.`status` = `status`.`id`)))
-            LEFT JOIN `issue_priority` `priority`
-               ON ((`issue`.`priority` = `priority`.`value`)))
-           LEFT JOIN `issue_type` `type`
-              ON ((`issue`.`type_id` = `type`.`id`)))
-          LEFT JOIN `sprint` ON ((`issue`.`sprint_id` = `sprint`.`id`))));
+ALTER TABLE issue ADD size_estimate VARCHAR(20) AFTER name;
 
-   # Update version
+ALTER VIEW `issue_detail`
+AS (
+  SELECT
+    `issue`.`id`               AS `id`,
+    `issue`.`status`           AS `status`,
+    `issue`.`type_id`          AS `type_id`,
+    `issue`.`name`             AS `name`,
+    `issue`.`size_estimate`    AS `size_estimate`,
+    `issue`.`description`      AS `description`,
+    `issue`.`parent_id`        AS `parent_id`,
+    `issue`.`author_id`        AS `author_id`,
+    `issue`.`owner_id`         AS `owner_id`,
+    `issue`.`priority`         AS `priority`,
+    `issue`.`hours_total`      AS `hours_total`,
+    `issue`.`hours_remaining`  AS `hours_remaining`,
+    `issue`.`hours_spent`      AS `hours_spent`,
+    `issue`.`created_date`     AS `created_date`,
+    `issue`.`closed_date`      AS `closed_date`,
+    `issue`.`deleted_date`     AS `deleted_date`,
+    `issue`.`start_date`       AS `start_date`,
+    `issue`.`due_date`         AS `due_date`,
+    isnull(`issue`.`due_date`) AS `has_due_date`,
+    `issue`.`repeat_cycle`     AS `repeat_cycle`,
+    `issue`.`sprint_id`        AS `sprint_id`,
+    `issue`.`due_date_sprint`  AS `due_date_sprint`,
+    `sprint`.`name`            AS `sprint_name`,
+    `sprint`.`start_date`      AS `sprint_start_date`,
+    `sprint`.`end_date`        AS `sprint_end_date`,
+    `type`.`name`              AS `type_name`,
+    `status`.`name`            AS `status_name`,
+    `status`.`closed`          AS `status_closed`,
+    `priority`.`id`            AS `priority_id`,
+    `priority`.`name`          AS `priority_name`,
+    `author`.`username`        AS `author_username`,
+    `author`.`name`            AS `author_name`,
+    `author`.`email`           AS `author_email`,
+    `author`.`task_color`      AS `author_task_color`,
+    `owner`.`username`         AS `owner_username`,
+    `owner`.`name`             AS `owner_name`,
+    `owner`.`email`            AS `owner_email`,
+    `owner`.`task_color`       AS `owner_task_color`
+  FROM `issue`
+  LEFT JOIN `user` `author` ON `issue`.`author_id` = `author`.`id`
+  LEFT JOIN `user` `owner` ON `issue`.`owner_id` = `owner`.`id`
+  LEFT JOIN `issue_status` `status` ON `issue`.`status` = `status`.`id`
+  LEFT JOIN `issue_priority` `priority` ON `issue`.`priority` = `priority`.`value`
+  LEFT JOIN `issue_type` `type` ON `issue`.`type_id` = `type`.`id`
+  LEFT JOIN `sprint` ON `issue`.`sprint_id` = `sprint`.`id`
+);
+
+# Update version
 UPDATE `config` SET `value` = '17.03.17' WHERE `attribute` = 'version';

File diff suppressed because it is too large
+ 8 - 2
db/database.sql