Commit f50df33e by Junaid Rahman pv

modified migrations for business and location(state,district)

parent bdd0e60a
......@@ -31,7 +31,6 @@ class m160831_080848_location extends Migration
], $tableOptions);
$this->createIndex('idx_state_name', '{{%state}}', 'name');
$this->createIndex('idx_state_id', '{{%district}}', 'state_id');
$this->createIndex('idx_district_name', '{{%district}}', 'name');
$this->addForeignKey('fk_state_id', '{{%district}}', 'state_id', '{{%state}}', 'id', 'RESTRICT', 'RESTRICT');
......@@ -42,6 +41,9 @@ class m160831_080848_location extends Migration
{
$this->dropForeignKey('fk_state_id', '{{%district}}');
$this->dropIndex('idx_district_name', '{{%district}}');
$this->dropIndex('idx_state_name', '{{%state}}');
$this->dropTable('{{%district}}');
$this->dropTable('{{%state}}');
}
......
......@@ -13,18 +13,18 @@ class m160831_092919_business extends Migration
$this->createTable('{{%business}}', [
'id' => $this->primaryKey(),
'category_id' => $this->integer()->notNull(),
'district_id' => $this->integer()->notNull(),
'category_id' => $this->integer(),
'district_id' => $this->integer(),
'domain_name' => $this->string(255)->notNull(),
'name' => $this->string(512),
'name' => $this->string(512)->notNull(),
'slug' => $this->string(1024),
'address' => $this->string(1024),
'address' => $this->string(1024)->notNull(),
'landmark' => $this->string(500),
'mobile_no' => $this->string(512),
'mobile_no' => $this->string(512)->notNull(),
'toll_free_no' => $this->string(512),
'contact_no' => $this->string(150),
'fax' => $this->string(512),
'email' => $this->string(1024),
'email' => $this->string(1024)->notNull(),
'website' => $this->string(1024),
'description' => $this->text(),
'logo_base_url' => $this->string(1024),
......@@ -36,8 +36,6 @@ class m160831_092919_business extends Migration
'updated_at' => $this->integer(11),
], $tableOptions);
$this->createIndex('idx-business-category_id', '{{%business}}', 'category_id');
$this->createIndex('idx-business-district_id', '{{%business}}', 'district_id');
$this->createIndex('idx-business-domain_name', '{{%business}}', 'domain_name');
$this->createIndex('idx-business-email', '{{%business}}', 'email');
......@@ -53,8 +51,6 @@ class m160831_092919_business extends Migration
$this->dropIndex('idx-business-email', '{{%business}}');
$this->dropIndex('idx-business-domain_name', '{{%business}}');
$this->dropIndex('idx-business-district_id', '{{%business}}');
$this->dropIndex('idx-business-category_id', '{{%business}}');
$this->dropTable('{{%business}}');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment