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