salix/db/changes/234201/00-supplierAccountCheckLeng...

7 lines
371 B
MySQL
Raw Normal View History

2023-09-11 16:28:47 +00:00
UPDATE `vn`.`supplier`
SET account = LPAD(id,10,'0')
WHERE account IS NULL;
ALTER TABLE `vn`.`supplier` ADD CONSTRAINT supplierAccountTooShort CHECK (LENGTH(account) = 10);
2023-10-06 06:03:37 +00:00
ALTER TABLE `vn`.`supplier` MODIFY COLUMN account varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 4100000000 NOT NULL COMMENT 'Default accounting code for suppliers.';