mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
25 lines
541 B
TypeScript
25 lines
541 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema';
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'collection_link';
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table
|
|
.uuid('collection_id')
|
|
.references('id')
|
|
.inTable('collections')
|
|
.onDelete('CASCADE');
|
|
table
|
|
.uuid('link_id')
|
|
.references('id')
|
|
.inTable('links')
|
|
.onDelete('CASCADE');
|
|
});
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName);
|
|
}
|
|
}
|