Log_service/database/migrations/1692586422677_users.ts

20 lines
476 B
TypeScript

import BaseSchema from "@ioc:Adonis/Lucid/Schema";
export default class extends BaseSchema {
protected tableName = "users";
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments("id_user").primary();
table.string("username", 50).notNullable();
table.string("password", 300).notNullable();
table.timestamps(true, true);
});
}
public async down() {
this.schema.dropTable(this.tableName);
}
}