create project

This commit is contained in:
2024-04-24 18:02:58 +03:00
commit 17df2ce6a9
276 changed files with 15932 additions and 0 deletions

View File

@ -0,0 +1,52 @@
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%addresses}}`.
*/
class m240110_153348_create_addresses_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('{{%addresses}}', [
'id' => $this->primaryKey(),
'address' => $this->string(255)->notNull(),
'company_id' => $this->integer(11)->notNull(),
'name' => $this->string(255),
]);
$this->createIndex('idx-addresses-company_id', 'addresses', 'company_id');
$this->addForeignKey(
'fk-addresses-company_id',
'addresses',
'company_id',
'company',
'id',
'CASCADE'
);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropForeignKey(
'fk-addresses-company_id',
'addresses'
);
// drops index for column `author_id`
$this->dropIndex(
'idx-addresses-company_id',
'addresses'
);
$this->dropTable('{{%addresses}}');
}
}