1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00

feat: message banners table migration (#5009)

https://linear.app/unleash/issue/2-1485/db-create-migration-for-a-new-internal-message-banners-table

Adds a DB migration for a new `message_banners` table.
This commit is contained in:
Nuno Góis 2023-10-12 11:27:00 +01:00 committed by GitHub
parent 2ab2aa1f6d
commit 66304cf8e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,32 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS message_banners
(
id SERIAL PRIMARY KEY NOT NULL,
enabled BOOLEAN DEFAULT true NOT NULL,
message TEXT NOT NULL,
variant TEXT,
sticky BOOLEAN DEFAULT false,
icon TEXT,
link TEXT,
link_text TEXT,
dialog_title TEXT,
dialog TEXT,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP TABLE IF EXISTS message_banners;
`,
cb,
);
};