Skip to content

Commit

Permalink
improvement(Migrate file)
Browse files Browse the repository at this point in the history
- Update size of inventory_type.text in schema.sql
- Fix error in migrate file us reference_number instead
  external_reference_number
- Add DROP PROCEDURE IF EXISTS for some Procedure
  • Loading branch information
lomamech committed Feb 15, 2022
1 parent ef37488 commit 766302d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions server/models/admin.sql
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ END$$
Removes all data from the cost_center_aggregate table and rebuilds it.
*/
DROP PROCEDURE IF EXISTS zRecalculateCostCenterAggregates$$
CREATE PROCEDURE zRecalculateCostCenterAggregates()
BEGIN

Expand Down
5 changes: 2 additions & 3 deletions server/models/migrations/next/migrate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ INSERT IGNORE INTO unit VALUES
* @date: 2022-02-07
*/
CALL add_column_if_missing('inventory', 'is_asset', 'TINYINT(1) NOT NULL DEFAULT 0 AFTER `importance`');
CALL add_column_if_missing('inventory', 'external_reference_number', 'TEXT NULL');
CALL add_column_if_missing('inventory', 'reference_number', 'TEXT NULL');
CALL add_column_if_missing('inventory', 'manufacturer_brand', 'TEXT NULL');
CALL add_column_if_missing('inventory', 'manufacturer_model', 'TEXT NULL');

CALL add_column_if_missing('inventory_type', 'description', 'TEXT NULL');
CALL add_column_if_missing('inventory_type', 'is_predefined', 'TINYINT(1) NOT NULL DEFAULT 0');

ALTER TABLE `inventory_type`
CHANGE COLUMN `text` `text` VARCHAR(200) NOT NULL COLLATE AFTER `id`;
ALTER TABLE `inventory_type` CHANGE COLUMN `text` `text` VARCHAR(200) NOT NULL;

2 changes: 1 addition & 1 deletion server/models/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ CREATE TABLE `inventory_group` (
DROP TABLE IF EXISTS `inventory_type`;
CREATE TABLE `inventory_type` (
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
`text` VARCHAR(30) NOT NULL,
`text` VARCHAR(200) NOT NULL,
`description` TEXT NULL,
`is_predefined` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
Expand Down

0 comments on commit 766302d

Please sign in to comment.