mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-12 02:39:09 +03:00
34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const Schema_1 = __importDefault(global[Symbol.for('ioc.use')]("Adonis/Lucid/Schema"));
|
|
class LessonMaterials extends Schema_1.default {
|
|
constructor() {
|
|
super(...arguments);
|
|
Object.defineProperty(this, "tableName", {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: 'lesson_materials'
|
|
});
|
|
}
|
|
async up() {
|
|
this.schema.createTable(this.tableName, table => {
|
|
table.increments('id').primary();
|
|
table.string('name').notNullable();
|
|
table.integer('size').notNullable();
|
|
table.string('client_name').notNullable();
|
|
table.string('ext').notNullable();
|
|
table.string('lesson_id', 21).unsigned().references('lessons.id').onDelete('CASCADE');
|
|
table.timestamp('created_at', { useTz: true });
|
|
table.timestamp('updated_at', { useTz: true });
|
|
});
|
|
}
|
|
async down() {
|
|
this.schema.dropTable(this.tableName);
|
|
}
|
|
}
|
|
exports.default = LessonMaterials;
|
|
//# sourceMappingURL=1637080400230_lesson_materials.js.map
|