mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
chore: init adonis
This commit is contained in:
21
database/migrations/1714218548323_create_users_table.ts
Normal file
21
database/migrations/1714218548323_create_users_table.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema';
|
||||
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'users';
|
||||
|
||||
async up() {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id').notNullable();
|
||||
table.string('full_name').nullable();
|
||||
table.string('email', 254).notNullable().unique();
|
||||
table.string('password').notNullable();
|
||||
|
||||
table.timestamp('created_at').notNullable();
|
||||
table.timestamp('updated_at').nullable();
|
||||
});
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable(this.tableName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user