email http functions

This commit is contained in:
ntr
2019-08-25 18:47:40 +10:00
parent b9f4a67e0c
commit df1ccdb8cd
9 changed files with 297 additions and 13 deletions
@@ -6,7 +6,9 @@ exports.up = async knex => {
table.string('name', 42).notNullable().unique();
table.string('password').notNullable();
table.string('token', 64).notNullable();
table.string('token', 64)
.notNullable()
.index();
table.timestamp('token_expiry').notNullable();
table.bigInteger('balance')
@@ -18,7 +20,6 @@ exports.up = async knex => {
.notNullable();
table.index('name');
table.index('id');
});
await knex.schema.raw(`
+35
View File
@@ -0,0 +1,35 @@
exports.up = async knex => {
await knex.schema.createTable('email', table => {
table.timestamps(true, true);
table.uuid('id')
.primary();
.index();
table.uuid('account')
.notNullable()
.index();
table.foreign('account')
.references('id')
.inTable('accounts')
.onDelete('CASCADE');
table.string('email', 128)
.unique()
.notNullable()
.index();
table.string('confirm_token', 64)
.notNullable()
.index();
table.bool('confirmed')
.notNullable()
.defaultTo(false);
});
return true;
};
exports.down = async () => {};