Skip to content

Commit

Permalink
feat: create client_applications_usage table migration (#4521)
Browse files Browse the repository at this point in the history
Creates client_applications_usage table

---------

Signed-off-by: andreas-unleash <[email protected]>
  • Loading branch information
andreas-unleash authored Aug 18, 2023
1 parent 208ca05 commit 4ce6c96
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/migrations/20230817095805-client-applications-usage-table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

exports.up = function (db, callback) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS client_applications_usage (
app_name VARCHAR(255) REFERENCES client_applications(app_name) ON DELETE CASCADE,
project VARCHAR(255) REFERENCES projects(id) ON DELETE CASCADE,
environment VARCHAR(100) REFERENCES environments(name) ON DELETE CASCADE,
PRIMARY KEY(app_name, project, environment)
) ;
`,
callback,
);
};

exports.down = function (db, callback) {
db.runSql(
`
DROP TABLE IF EXISTS client_applications_usage;
`,
callback,
);
};

0 comments on commit 4ce6c96

Please sign in to comment.