Commit 9ba1f463 authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Re order db-upgrade-4-5

parent 86ec86a5
......@@ -4,7 +4,7 @@
--
--
-- Upgrade table
-- ALTER TABLE
--
ALTER TABLE `listing` MODIFY COLUMN `barcode` BIGINT DEFAULT NULL;
......@@ -16,14 +16,18 @@ UPDATE `listing` SET `max_day` = 0;
ALTER TABLE `version` ADD COLUMN `updated_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE `pret` ADD COLUMN `status` ENUM('LOAN_BORROWED', 'LOAN_RESERVED', 'LOAN_RETURNED') NOT NULL;
UPDATE `pret` SET `status` = 'LOAN_BORROWED';
--
-- Fix global DB version
-- UPDATE TABLE
--
UPDATE `pret` SET `status` = 'LOAN_BORROWED';
UPDATE `version` SET `version` = 5 WHERE `soft` = 'database';
--
-- ADD TABLE
--
RENAME TABLE `intervention` TO `old_intervention`;
CREATE TABLE IF NOT EXISTS `intervention` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
......@@ -35,4 +39,3 @@ CREATE TABLE IF NOT EXISTS `intervention` (
FOREIGN KEY (`supplier_id`) REFERENCES `fournisseurs`(`id`),
FOREIGN KEY (`equipment_id`) REFERENCES `listing`(`id`)
) ENGINE=MyISAM AUTO_INCREMENT=700 CHARSET=utf8;
-- KEY `company_id` (`supplier_id`),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment