Skip to content

Commit

Permalink
feat: collect onboarding events in separate table (#8020)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus authored Aug 30, 2024
1 parent 52e3ff0 commit 4079485
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/migrations/20240830102144-onboarding-events.js
Original file line number Diff line number Diff line change
@@ -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);
};

0 comments on commit 4079485

Please sign in to comment.