create project
This commit is contained in:
33
console/migrations/m240110_152351_create_company_table.php
Normal file
33
console/migrations/m240110_152351_create_company_table.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%company}}`.
|
||||
*/
|
||||
class m240110_152351_create_company_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%company}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'inn' => $this->string(255)->notNull(),
|
||||
'name' => $this->string(255)->notNull(),
|
||||
'address' => $this->string(255),
|
||||
'created_at' => $this->dateTime(),
|
||||
'updated_at' => $this->dateTime(),
|
||||
'status' => $this->integer(1)->defaultValue(1)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%company}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user