Commit bf196d21 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлена миграция для таблицы файлов уроков

parent 768be2a9
<?php
use yii\db\Migration;
class m160412_092830_add_analytics_school_lesson_files_table extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->createTable(
'analytics_school_lesson_file',
[
'id' => $this->primaryKey(),
'lesson_id' => $this->integer(11)->notNull(),
'title' => $this->string(255)->notNull(),
'file' => $this->text()->notNull()
]
);
$this->addForeignKey(
'fk_analytics_school_lesson_file_lesson_id',
'analytics_school_lesson_file', 'lesson_id',
'analytics_school_lesson', 'id'
);
}
public function safeDown()
{
$this->dropForeignKey(
'fk_analytics_school_lesson_file_lesson_id',
'analytics_school_lesson_file'
);
$this->dropTable('fk_analytics_school_lesson_file_lesson_id');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment