- added migration files for creating db table for 'backupcodes'
This commit is contained in:
parent
49ea0fc967
commit
f4854d70b9
|
@ -1,3 +1,28 @@
|
||||||
|
// node ace make:migration backupcodes
|
||||||
|
import { BaseSchema } from '@adonisjs/lucid/schema';
|
||||||
|
|
||||||
|
export default class extends BaseSchema {
|
||||||
|
protected tableName = 'backupcodes';
|
||||||
|
|
||||||
|
async up() {
|
||||||
|
this.schema.createTable(this.tableName, (table) => {
|
||||||
|
table.increments('id');
|
||||||
|
|
||||||
|
table.integer('user_id').unsigned();
|
||||||
|
table.string('code', 64).notNullable();
|
||||||
|
table.boolean('used').defaultTo(false);
|
||||||
|
|
||||||
|
table.foreign('user_id').references('id').inTable('accounts').onUpdate('CASCADE').onDelete('CASCADE');
|
||||||
|
|
||||||
|
table.index('user_id', 'backupcodes_uid');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async down() {
|
||||||
|
this.schema.dropTable(this.tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// CREATE SEQUENCE IF NOT EXISTS gba.backupcodes_id_seq
|
// CREATE SEQUENCE IF NOT EXISTS gba.backupcodes_id_seq
|
||||||
// INCREMENT 1
|
// INCREMENT 1
|
||||||
// START 1
|
// START 1
|
||||||
|
@ -5,7 +30,6 @@
|
||||||
// MAXVALUE 2147483647
|
// MAXVALUE 2147483647
|
||||||
// CACHE 1;
|
// CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
// ALTER SEQUENCE gba.backupcodes_id_seq
|
// ALTER SEQUENCE gba.backupcodes_id_seq
|
||||||
// OWNER TO tethys_admin;
|
// OWNER TO tethys_admin;
|
||||||
|
|
||||||
|
@ -26,7 +50,6 @@
|
||||||
// CONSTRAINT backupcodes_pkey PRIMARY KEY (id)
|
// CONSTRAINT backupcodes_pkey PRIMARY KEY (id)
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
|
||||||
// CREATE INDEX IF NOT EXISTS backupcodes_uid
|
// CREATE INDEX IF NOT EXISTS backupcodes_uid
|
||||||
// ON gba.backupcodes USING btree
|
// ON gba.backupcodes USING btree
|
||||||
// (user_id ASC);
|
// (user_id ASC);
|
866
package-lock.json
generated
866
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -85,6 +85,5 @@
|
||||||
"assets/images/marker-icon.png": "http://localhost:8080/assets/images/marker-icon.2b3e1faf.png",
|
"assets/images/marker-icon.png": "http://localhost:8080/assets/images/marker-icon.2b3e1faf.png",
|
||||||
"assets/images/layers-2x.png": "http://localhost:8080/assets/images/layers-2x.8f2c4d11.png",
|
"assets/images/layers-2x.png": "http://localhost:8080/assets/images/layers-2x.8f2c4d11.png",
|
||||||
"assets/images/layers.png": "http://localhost:8080/assets/images/layers.416d9136.png",
|
"assets/images/layers.png": "http://localhost:8080/assets/images/layers.416d9136.png",
|
||||||
"assets/images/Close.svg": "http://localhost:8080/assets/images/Close.e4887675.svg",
|
"assets/images/Close.svg": "http://localhost:8080/assets/images/Close.e4887675.svg"
|
||||||
"assets/vendors-node_modules_vue-facing-decorator_dist_esm_index_js-node_modules_vue-facing-decorator-818045.js": "http://localhost:8080/assets/vendors-node_modules_vue-facing-decorator_dist_esm_index_js-node_modules_vue-facing-decorator-818045.js"
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user