email http functions
This commit is contained in:
@@ -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(`
|
||||
|
||||
@@ -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 () => {};
|
||||
Reference in New Issue
Block a user