1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

feat: collect onboarding events in separate table (#8020)

This commit is contained in:
Jaanus Sellin 2024-08-30 11:34:47 +03:00 committed by GitHub
parent 52e3ff03d2
commit 4079485338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,30 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS onboarding_events_instance (
event VARCHAR(255) NOT NULL,
time_to_event INTEGER NOT NULL, -- in seconds
PRIMARY KEY (event)
);
CREATE TABLE IF NOT EXISTS onboarding_events_project (
event VARCHAR(255) NOT NULL,
time_to_event INTEGER NOT NULL, -- in seconds
project VARCHAR(255) NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
PRIMARY KEY (event, project)
);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP TABLE IF EXISTS onboarding_events_instance;
DROP TABLE IF EXISTS onboarding_events_project;
`,
cb);
};