|
| 1 | +const { Database } = require('@formidablejs/framework'); |
| 2 | + |
| 3 | +/** @param {Database} DB */ |
| 4 | +exports.up = ({ schema }) => { |
| 5 | + schema.createTable('users', (table) => { |
| 6 | + table.increments('id').primary(); |
| 7 | + table.string('name'); |
| 8 | + table.string('email').unique(); |
| 9 | + table.timestamp('email_verified_at').nullable(); |
| 10 | + table.string('password'); |
| 11 | + table.rememberToken(); |
| 12 | + table.timestamps(true, true); |
| 13 | + }); |
| 14 | + |
| 15 | + |
| 16 | + schema.createTable('password_resets', (table) => { |
| 17 | + table.string('email').primary().unique(); |
| 18 | + table.string('token'); |
| 19 | + table.timestamp('created_at').defaultTo(fn.now()); |
| 20 | + }); |
| 21 | + |
| 22 | + schema.createTable('personal_access_tokens', (table) => { |
| 23 | + table.increments('id').primary(); |
| 24 | + table.string('tokenable_type'); |
| 25 | + table.bigInteger('tokenable_id').index().unsigned(); |
| 26 | + table.string('name'); |
| 27 | + table.string('abilities').nullable(); |
| 28 | + table.text('payload').nullable(); |
| 29 | + table.bigInteger('ttl').index().unsigned().nullable(); |
| 30 | + table.timestamp('last_used_at').nullable(); |
| 31 | + table.timestamps(); |
| 32 | + }); |
| 33 | + |
| 34 | + return schema; |
| 35 | +} |
| 36 | + |
| 37 | +/** @param {Database} DB */ |
| 38 | +exports.down = ({ schema }) => { |
| 39 | + schema.dropTable('users'); |
| 40 | + schema.dropTable('password_resets'); |
| 41 | + schema.dropTable('personal_access_tokens'); |
| 42 | + |
| 43 | + return schema; |
| 44 | +} |
0 commit comments