-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2532: Release v0.7.0 r=jniles a=jniles This release packages all changes since December 2017. Remember to update your dependencies!
- Loading branch information
Showing
4 changed files
with
161 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
This script will update the database to its current version. | ||
*/ | ||
|
||
SET foreign_key_checks = 0; | ||
ALTER TABLE inventory_group ADD COLUMN `expires` TINYINT(1) DEFAULT 1; | ||
ALTER TABLE inventory_group ADD COLUMN `unique_item` TINYINT(1) DEFAULT 0; | ||
|
||
ALTER TABLE account DROP COLUMN `is_asset`; | ||
ALTER TABLE account DROP COLUMN `is_brut_link`; | ||
ALTER TABLE account DROP COLUMN `is_title`; | ||
ALTER TABLE account DROP COLUMN `is_charge`; | ||
|
||
DROP TABLE `config_rubric`; | ||
DROP TABLE `config_rubric_item`; | ||
DROP TABLE `config_tax`; | ||
DROP TABLE `config_tax_item`; | ||
|
||
DROP TABLE `cotisation`; | ||
DROP TABLE `cotisation_paiement`; | ||
DROP TABLE `paiement_period`; | ||
|
||
DROP TABLE `rubric`; | ||
DROP TABLE `rubric_paiement`; | ||
|
||
DROP TABLE `tax`; | ||
DROP TABLE `tax_paiement`; | ||
|
||
DROP TABLE `config_cotisation_item`; | ||
DROP TABLE `config_cotisation`; | ||
|
||
DROP TABLE IF EXISTS `rubric_payroll`; | ||
|
||
CREATE TABLE `rubric_payroll` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`label` VARCHAR(80) NOT NULL, | ||
`abbr` varchar(6) DEFAULT NULL, | ||
`is_employee` tinyint(1) DEFAULT 0, | ||
`is_percent` tinyint(1) DEFAULT 0, | ||
`is_discount` tinyint(1) DEFAULT 0, | ||
`is_tax` tinyint(1) DEFAULT 0, | ||
`is_social_care` tinyint(1) DEFAULT 0, | ||
`debtor_account_id` int(10) unsigned DEFAULT NULL, | ||
`expense_account_id` int(10) unsigned DEFAULT NULL, | ||
`is_ipr` tinyint(1) DEFAULT 0, | ||
`value` float DEFAULT 0, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `rubric_payroll_1` (`label`), | ||
KEY `debtor_account_id` (`debtor_account_id`), | ||
KEY `expense_account_id` (`expense_account_id`), | ||
FOREIGN KEY (`debtor_account_id`) REFERENCES `account` (`id`), | ||
FOREIGN KEY (`expense_account_id`) REFERENCES `account` (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
-- For some reason, MariaDB is being a pain with this. Skipping it for now. | ||
-- ALTER TABLE `offday` DROP CONSTRAINT `offday_1`; | ||
-- ALTER TABLE `offday` ADD UNIQUE `offday_1` (`date`); | ||
|
||
ALTER TABLE `inventory` ADD COLUMN `is_broken` TINYINT(1) NOT NULL DEFAULT 0; | ||
ALTER TABLE `inventory` ADD COLUMN `note` text NULL; | ||
|
||
ALTER TABLE `patient` ADD COLUMN `health_zone` VARCHAR(30); | ||
ALTER TABLE `patient` ADD COLUMN `health_area` VARCHAR(30); | ||
|
||
ALTER TABLE `inventory` ADD COLUMN `last_purchase` DATE NULL COMMENT 'This element allows to store the date of the last purchase order of the product in order to allow the calculation without making much of the average ordering interval'; | ||
ALTER TABLE `inventory` ADD COLUMN `num_purchase` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Number of purchase orders'; | ||
ALTER TABLE `inventory` ADD COLUMN `num_delivery` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Number of stock delivery'; | ||
|
||
ALTER TABLE `inventory` CHANGE COLUMN `delay` `delay` DECIMAL(10,4) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Delivery time'; | ||
ALTER TABLE `inventory` CHANGE COLUMN `avg_consumption` `avg_consumption` DECIMAL(10,4) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Average consumption' ; | ||
ALTER TABLE `inventory` CHANGE COLUMN `purchase_interval` `purchase_interval` DECIMAL(10,4) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Purchase Order interval' ; | ||
|
||
DROP TABLE IF EXISTS `taxe_ipr`; | ||
CREATE TABLE `taxe_ipr` ( | ||
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
`label` VARCHAR(100) NOT NULL, | ||
`description` TEXT, | ||
`currency_id` TINYINT(3) UNSIGNED NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `currency_id` (`currency_id`), | ||
FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`) ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
DROP TABLE IF EXISTS `taxe_ipr_configuration`; | ||
CREATE TABLE `taxe_ipr_configuration` ( | ||
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
`rate` float NOT NULL, | ||
`tranche_annuelle_debut` float DEFAULT NULL, | ||
`tranche_annuelle_fin` float DEFAULT NULL, | ||
`tranche_mensuelle_debut` float DEFAULT NULL, | ||
`tranche_mensuelle_fin` float DEFAULT NULL, | ||
`ecart_annuel` float DEFAULT NULL, | ||
`ecart_mensuel` float DEFAULT NULL, | ||
`impot_annuel` float DEFAULT NULL, | ||
`impot_mensuel` float DEFAULT NULL, | ||
`cumul_annuel` float DEFAULT NULL, | ||
`cumul_mensuel` float DEFAULT NULL, | ||
`taxe_ipr_id` int(10) UNSIGNED NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `taxe_ipr_id` (`taxe_ipr_id`), | ||
FOREIGN KEY (`taxe_ipr_id`) REFERENCES `taxe_ipr` (`id`) ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
|
||
SET foreign_key_checks = 1; |