aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0710-live-sessions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0710-live-sessions.ts')
-rw-r--r--server/initializers/migrations/0710-live-sessions.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/server/initializers/migrations/0710-live-sessions.ts b/server/initializers/migrations/0710-live-sessions.ts
new file mode 100644
index 000000000..aaac8d9ce
--- /dev/null
+++ b/server/initializers/migrations/0710-live-sessions.ts
@@ -0,0 +1,34 @@
1import * as Sequelize from 'sequelize'
2
3async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7 db: any
8}): Promise<void> {
9 const { transaction } = utils
10
11 const query = `
12 CREATE TABLE IF NOT EXISTS "videoLiveSession" (
13 "id" serial,
14 "startDate" timestamp with time zone NOT NULL,
15 "endDate" timestamp with time zone,
16 "error" integer,
17 "replayVideoId" integer REFERENCES "video" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
18 "liveVideoId" integer REFERENCES "video" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
19 "createdAt" timestamp with time zone NOT NULL,
20 "updatedAt" timestamp with time zone NOT NULL,
21 PRIMARY KEY ("id")
22 );
23 `
24 await utils.sequelize.query(query, { transaction })
25}
26
27function down () {
28 throw new Error('Not implemented.')
29}
30
31export {
32 up,
33 down
34}