diff --git a/src/migrations/20250521160000-add-cdn-tokens-table.js b/src/migrations/20250521160000-add-cdn-tokens-table.js new file mode 100644 index 0000000000..60e7ab0e13 --- /dev/null +++ b/src/migrations/20250521160000-add-cdn-tokens-table.js @@ -0,0 +1,20 @@ +exports.up = (db, callback) => { + db.runSql( + `CREATE TABLE IF NOT EXISTS cdn_tokens + ( + id text not null PRIMARY KEY, + token_name text not null, + project text not null, + environment text not null, + created_at TIMESTAMP WITH TIME ZONE DEFAULT now(), + expires_at TIMESTAMP WITH TIME ZONE, + seen_at TIMESTAMP WITH TIME ZONE + ); + `, + callback, + ); +}; + +exports.down = (db, callback) => { + db.runSql('DROP TABLE IF EXISTS cdn_tokens;', callback); +};