salix/db/versions/11010-blackChrysanthemum/00-firstScript.sql

22 lines
1.0 KiB
MySQL
Raw Permalink Normal View History

2024-04-24 12:08:26 +00:00
ALTER TABLE vn.deviceProductionUser DROP INDEX IF EXISTS deviceProductionUser_UN;
ALTER TABLE vn.deviceProductionUser DROP FOREIGN KEY IF EXISTS deviceProductionUser_FK;
ALTER TABLE vn.deviceProductionUser DROP PRIMARY KEY;
ALTER TABLE vn.deviceProductionUser ADD IF NOT EXISTS id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY FIRST;
2024-04-24 09:08:57 +00:00
ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_deviceProduction_FK FOREIGN KEY IF NOT EXISTS (deviceProductionFk) REFERENCES vn.deviceProduction(id);
2024-04-24 09:08:57 +00:00
ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_unique UNIQUE KEY IF NOT EXISTS (deviceProductionFk);
ALTER TABLE vn.deviceProductionUser ADD IF NOT EXISTS simSerialNumber TEXT NULL;
ALTER TABLE vn.deviceProductionConfig ADD IF NOT EXISTS maxDevicesPerUser INT UNSIGNED NULL;
2024-04-24 12:29:57 +00:00
UPDATE vn.deviceProductionConfig SET maxDevicesPerUser=1 WHERE id=1;
INSERT IGNORE INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Worker','getAvailablePda','READ','ALLOW','ROLE','hr');