mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 02:09:07 +03:00
25 lines
808 B
TypeScript
25 lines
808 B
TypeScript
import BaseSchema from '@ioc:Adonis/Lucid/Schema';
|
|
|
|
export default class LessonVideos extends BaseSchema {
|
|
protected tableName = 'lesson_videos';
|
|
|
|
public async up() {
|
|
this.schema.createTable(this.tableName, table => {
|
|
table.increments('id');
|
|
table.string('lesson_id', 21).unsigned().references('lessons.id').onDelete('CASCADE').notNullable();
|
|
table.string('name').notNullable();
|
|
table.integer('size').notNullable();
|
|
table.string('client_name').notNullable();
|
|
table.string('ext').notNullable();
|
|
table.string('url').notNullable();
|
|
table.timestamp('created_at', { useTz: true });
|
|
table.timestamp('updated_at', { useTz: true });
|
|
table.unique(['lesson_id']);
|
|
});
|
|
}
|
|
|
|
public async down() {
|
|
this.schema.dropTable(this.tableName);
|
|
}
|
|
}
|