d55d2fe0
Yarik
Multilanguage
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?php
use yii\db\Migration;
/**
* Handles the creation for table `project_lang`.
*/
class m160930_082350_create_project_lang_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('project_lang', [
'project_id' => $this->integer()
->notNull(),
'language_id' => $this->integer()
->notNull(),
'title' => $this->string()
->notNull(),
'description' => $this->text(),
]);
$this->createIndex('project_lang_project_language_key', 'project_lang', [
'project_id',
'language_id',
], true);
$this->addForeignKey('project_fk', 'project_lang', 'project_id', 'project', 'project_id', 'CASCADE', 'CASCADE');
|
8af13427
Yarik
For leha commit.
|
31
|
$this->addForeignKey('language_fk', 'project_lang', 'language_id', 'language', 'id', 'RESTRICT', 'CASCADE');
|