first commit
This commit is contained in:
33
console/migrations/m230503_151354_create_text_table.php
Executable file
33
console/migrations/m230503_151354_create_text_table.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%text}}`.
|
||||
*/
|
||||
class m230503_151354_create_text_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%text}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'profile_id' => $this->integer(),
|
||||
'title' => $this->string(),
|
||||
'text' => $this->text(),
|
||||
'language' => $this->string()
|
||||
]);
|
||||
$this->addForeignKey('profile_foreign', 'text', 'profile_id', 'profile', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('profile_foreign', 'text');
|
||||
$this->dropTable('{{%text}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user