This commit is contained in:
ntr
2018-09-16 23:56:37 +10:00
parent 8fb7a3ae1e
commit a78b796c55
10 changed files with 209 additions and 90 deletions
@@ -1,5 +1,5 @@
exports.up = async knex => {
return knex.schema.createTable('users', table => {
return knex.schema.createTable('accounts', table => {
table.uuid('id').primary();
table.string('name', 42).notNullable().unique();
table.string('password').notNullable();
+14
View File
@@ -0,0 +1,14 @@
exports.up = async knex => {
return knex.schema.createTable('cryps', table => {
table.uuid('id').primary();
table.uuid('account').notNullable()
table.foreign('account')
.references('id')
.inTable('accounts')
.onDelete('CASCADE');
table.binary('data').notNullable();
table.index('id');
});
};
exports.down = async () => {};