1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-22 01:16:07 +02:00

Feat/tag colors migration (#9560)

Adds a color field to the tag types table
This commit is contained in:
Fredrik Strand Oseberg 2025-03-18 15:01:59 +01:00 committed by GitHub
parent 890bbcaaa0
commit 9bdad5ee44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,23 @@
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE tag_types
ADD COLUMN IF NOT EXISTS color VARCHAR(10);
UPDATE tag_types
SET color = '#FFFFFF'
WHERE color IS NULL;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
ALTER TABLE tag_types
DROP COLUMN IF EXISTS color;
`,
cb,
);
};