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:
parent
2ab2aa1f6d
commit
66304cf8e7
32
src/migrations/20231012082537-message-banners.js
Normal file
32
src/migrations/20231012082537-message-banners.js
Normal 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,
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user