brainz-social-old/migrations/20231001203802-csrfToken.js

32 lines
610 B
JavaScript
Raw Normal View History

2023-10-01 16:02:20 -05:00
"use strict";
let dbm;
let type;
let seed;
/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
2023-10-08 23:14:04 -05:00
exports.setup = function (options, seedLink) {
2023-10-01 16:02:20 -05:00
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};
2023-10-08 23:14:04 -05:00
exports.up = function (db) {
2023-10-01 16:02:20 -05:00
return db.createTable("csrf_token", {
2023-10-08 23:14:04 -05:00
id: {type: "int", primaryKey: true, autoIncrement: true},
2023-10-01 16:02:20 -05:00
url: "string",
2023-10-08 23:14:04 -05:00
created_at: "int",
2023-10-01 16:02:20 -05:00
});
};
2023-10-08 23:14:04 -05:00
exports.down = function (db) {
2023-10-01 16:02:20 -05:00
return db.dropTable("csrf_token");
};
exports._meta = {
2023-10-08 23:14:04 -05:00
version: 1,
2023-10-01 16:02:20 -05:00
};