brainz-social-old/migrations/20231007184818-jsonldSchemaCache.js

33 lines
659 B
JavaScript
Raw Normal View History

2023-10-07 14:36:11 -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-07 14:36:11 -05:00
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};
2023-10-08 23:14:04 -05:00
exports.up = function (db) {
2023-10-07 14:36:11 -05:00
return db.createTable("jsonld_schema_cache", {
id: {type: "int", primaryKey: true, autoIncrements: true},
schema_uri: "string",
schema: "string",
2023-10-08 23:14:04 -05:00
expires: "int",
2023-10-07 14:36:11 -05:00
});
};
2023-10-08 23:14:04 -05:00
exports.down = function (db) {
2023-10-07 14:36:11 -05:00
return db.dropTable("jsonld_schema_cache");
};
exports._meta = {
2023-10-08 23:14:04 -05:00
version: 1,
2023-10-07 14:36:11 -05:00
};