add indexes, add messagedetsta

This commit is contained in:
2016-01-29 17:13:33 +01:00
parent ad59cbb940
commit a00331ce7c
65 changed files with 3195 additions and 92 deletions

View File

@@ -0,0 +1,30 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160128_130803_add_index_customer_id_customer_card extends Migration
{
public function up()
{
$this->execute("CREATE INDEX ix_customer_id_customer_card ON customer (id_customer_card);");
}
public function down()
{
echo "m160128_130803_add_index_customer_id_customer_card cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@@ -0,0 +1,39 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160128_131700_add_index_transfer_id_object_type extends Migration
{
public function up()
{
$this->execute("CREATE INDEX transfer_object_type ON transfer (id_object,type);");
$this->execute("CREATE INDEX transfer_object_type_status ON transfer (id_object,type,status);");
$this->execute("CREATE INDEX transfer_status ON transfer (status);");
$this->execute("CREATE INDEX transfer_paid_by ON transfer (paid_by);");
$this->execute("CREATE INDEX transfer_paid_at ON transfer (paid_at);");
$this->execute("CREATE INDEX transfer_paid_at_by ON transfer (paid_by,paid_at);");
$this->execute("CREATE INDEX transfer_discount ON transfer (id_discount);");
$this->execute("CREATE INDEX transfer_customer ON transfer (id_customer);");
$this->execute("CREATE INDEX transfer_user ON transfer (id_user);");
$this->execute("CREATE INDEX transfer_created ON transfer (created_at);");
}
public function down()
{
echo "m160128_131700_add_index_transfer_id_object_type cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@@ -0,0 +1,113 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160129_072601_add__tables__detsta_message extends Migration
{
public function up()
{
$this->addMessage();
$this->addMessageFej();
$this->addMessageLab();
$this->addMessageTetel();
}
protected function addMessage(){
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%message_detsta}}', [
'id_message' => $this->primaryKey(),
'path' => $this->string(255),
'id_user' => $this->integer(11),
'created_at' => $this->dateTime()->notNull(),
'updated_at' => $this->dateTime()->notNull(),
], $tableOptions);
}
protected function addMessageFej(){
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%message_detsta_fej}}', [
'id_message_detsta_fej' => $this->primaryKey(),
'id_message' => $this->integer(11),
'record_tipus' => $this->string(10),
'uzenet_tipus' => $this->string(10),
'jelentes_jelzo' => $this->string(10),
'kezdemenyezo_azonosito' => $this->string(20),
'csoportos_uzenet_sorszam' => $this->integer(11),
'csoportos_uzenet_datum' => $this->dateTime(),
'detsta_uzenet_sorszam' => $this->integer(11),
'detsta_uzenet_datum' => $this->dateTime(),
'ido' => $this->string(10),
], $tableOptions);
}
protected function addMessageLab(){
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%message_detsta_lab}}', [
'id_message_detsta_lab' => $this->primaryKey(),
'id_message' => $this->integer(11),
'record_tipus' => $this->string(10),
'teljesitett_tetelek_szama' => $this->integer(11),
'teljesitett_tetelek_osszerteke' => $this->integer(11),
'visszautasitott_tetelek_szama' => $this->integer(11),
'visszautasitott_tetelek_osszerteke' => $this->integer(11),
'megnemvalaszolt_tetelek_szama' => $this->integer(11),
'megnemvalaszolt_tetelek_osszerteke' => $this->integer(11),
], $tableOptions);
}
protected function addMessageTetel(){
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%message_detsta_tetel}}', [
'id_message_detsta_tetel' => $this->primaryKey(),
'id_message' => $this->integer(11),
'id_ticket_installment_request' => $this->integer(11),
'record_tipus' => $this->string(10),
'tetel_sorszam' => $this->integer(11),
'osszeg' => $this->integer(11),
'eredeti_tetel_elszamolasi_datuma' => $this->dateTime(),
'visszajelzes_informacio' => $this->string(10),
'feldolgozas_datum' => $this->dateTime(),
'terhelesi_datum' => $this->dateTime(),
'valasz_hivatkozasi_kod' => $this->string(50),
'eredeti_hivatkozasi_kod' => $this->string(50),
'ugyfel_azonosito' => $this->string(50),
], $tableOptions);
}
public function down()
{
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@@ -0,0 +1,30 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160129_114910_alter__table__message_detsta__add__column__id_ugiro extends Migration
{
public function up()
{
$this->addColumn("message_detsta", "id_ugiro", "int");
}
public function down()
{
echo "m160129_114910_alter__table__message_detsta__add__column__id_ugiro cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}