"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. */ exports.setup = function (options, seedLink) { dbm = options.dbmigrate; type = dbm.dataType; seed = seedLink; }; exports.up = function (db, callback) { db.createTable("accounts", { id: {type: "int", primaryKey: true, autoIncrement: true}, username: {type: "string", unique: true}, email: "string", password_hash: "string", account_tier: "int", }, (result) => { if (result) { callback(result); } db.runSql("INSERT INTO \"accounts\" (\"username\",\"email\",\"password_hash\",\"account_tier\") VALUES (\"guest\",\"null@null.null\",\"purposely_invalid_password\",0);", callback); }); }; exports.down = function (db) { return db.dropTable("accounts"); }; exports._meta = { version: 1, };