Skip to content

Commit

Permalink
Update schema updated
Browse files Browse the repository at this point in the history
Update instructions updated
  • Loading branch information
pHAlkaline committed Apr 26, 2016
1 parent cf4b92c commit 4a6b4d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion UPDATE.README
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Always make a backup.
Be very careful when updating app/Config directory files.
Take very special attention to core.php , do not update salt and cipherSeed.
Take very special attention to database schema.
pHAlkaline strongly suggest the use of a diff software, like winmerge , melddiff or similar to see code and db schema changes.
pHAlkaline strongly suggest the use of a diff software, like winmerge , melddiff or similar to see code and db schema changes.
Clear cache , delete all files at app/tmp/cache subdirectories except empty
26 changes: 13 additions & 13 deletions app/Config/Schema/update-1.4.3to1.5.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

ALTER TABLE `default_schema`.`phkapa_actions`
ALTER TABLE `phkapa_actions`
DROP FOREIGN KEY `phkapa_actions_ibfk_4`;

ALTER TABLE `default_schema`.`phkapa_tickets`
ALTER TABLE `phkapa_tickets`
DROP FOREIGN KEY `phkapa_tickets_ibfk_17`;

CREATE TABLE IF NOT EXISTS `default_schema`.`phkapa_customers` (
CREATE TABLE IF NOT EXISTS `phkapa_customers` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL DEFAULT '',
`active` TINYINT(1) NOT NULL DEFAULT '1',
Expand All @@ -20,41 +20,41 @@ AUTO_INCREMENT = 1
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;

ALTER TABLE `default_schema`.`phkapa_tickets`
ALTER TABLE `phkapa_tickets`
ADD COLUMN `customer_id` INT(11) NULL DEFAULT NULL AFTER `supplier_id`,
ADD COLUMN `product` VARCHAR(100) NULL DEFAULT NULL AFTER `customer_id`,
ADD INDEX `CustomerIdKey` (`customer_id` ASC);

ALTER TABLE `default_schema`.`phkapa_tickets_revision`
ALTER TABLE `phkapa_tickets_revision`
ADD COLUMN `customer_id` INT(11) NULL DEFAULT NULL AFTER `supplier_id`,
ADD COLUMN `product` VARCHAR(100) NULL DEFAULT NULL AFTER `customer_id`,
ADD INDEX `CustomerIdKey` (`customer_id` ASC),
ADD INDEX `SafetyIdKey` (`safety_id` ASC);

ALTER TABLE `default_schema`.`phkapa_actions`
ALTER TABLE `phkapa_actions`
ADD CONSTRAINT `phkapa_actions_ibfk_4`
FOREIGN KEY (`action_effectiveness_id`)
REFERENCES `default_schema`.`phkapa_action_effectivenesses` (`id`)
REFERENCES `phkapa_action_effectivenesses` (`id`)
ON UPDATE CASCADE;

ALTER TABLE `default_schema`.`phkapa_tickets`
ALTER TABLE `phkapa_tickets`
ADD CONSTRAINT `phkapa_tickets_ibfk_17`
FOREIGN KEY (`customer_id`)
REFERENCES `default_schema`.`phkapa_customers` (`id`)
REFERENCES `phkapa_customers` (`id`)
ON UPDATE CASCADE,
ADD CONSTRAINT `phkapa_tickets_ibfk_18`
FOREIGN KEY (`safety_id`)
REFERENCES `default_schema`.`phkapa_safeties` (`id`)
REFERENCES `phkapa_safeties` (`id`)
ON UPDATE CASCADE;

ALTER TABLE `default_schema`.`phkapa_tickets_revision`
ALTER TABLE `phkapa_tickets_revision`
ADD CONSTRAINT `phkapa_tickets_revision_ibfk_16`
FOREIGN KEY (`customer_id`)
REFERENCES `default_schema`.`phkapa_customers` (`id`)
REFERENCES `phkapa_customers` (`id`)
ON UPDATE CASCADE,
ADD CONSTRAINT `phkapa_tickets_revision_ibfk_17`
FOREIGN KEY (`safety_id`)
REFERENCES `default_schema`.`phkapa_safeties` (`id`)
REFERENCES `phkapa_safeties` (`id`)
ON UPDATE CASCADE;


Expand Down

0 comments on commit 4a6b4d7

Please sign in to comment.