chore: create user, collection and link models, migrations and seeders

This commit is contained in:
Sonny
2024-04-28 00:45:10 +02:00
committed by Sonny
parent 08dcd7455f
commit 231629f0dd
17 changed files with 311 additions and 32 deletions

View File

@@ -0,0 +1,25 @@
import { BaseSchema } from '@adonisjs/lucid/schema';
export default class extends BaseSchema {
protected tableName = 'links';
async up() {
this.schema.createTable(this.tableName, (table) => {
table.uuid('id').notNullable();
table.string('name', 254).notNullable();
table.string('description', 254);
table.text('url').notNullable();
table.boolean('favorite').notNullable().defaultTo(0);
table.uuid('collection_id').notNullable();
table.uuid('author_id').notNullable();
table.timestamp('created_at');
table.timestamp('updated_at');
});
}
async down() {
this.schema.dropTable(this.tableName);
}
}