Преглед на файлове

[Backend] Documents : ralentissement page index #288

refactoring
Guillaume Bourgeois преди 2 години
родител
ревизия
9f1cb99557
променени са 1 файла, в които са добавени 47 реда и са изтрити 0 реда
  1. +47
    -0
      console/migrations/m220817_074240_add_foreign_keys_documents.php

+ 47
- 0
console/migrations/m220817_074240_add_foreign_keys_documents.php Целия файл

@@ -0,0 +1,47 @@
<?php

use yii\db\Migration;

/**
* Class m220817_074240_add_foreign_keys_documents
*/
class m220817_074240_add_foreign_keys_documents extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createIndex('user_fk', 'delivery_note', ['id_user']);
$this->createIndex('producer_fk', 'delivery_note', ['id_producer']);

$this->createIndex('user_fk', 'quotation', ['id_user']);
$this->createIndex('producer_fk', 'quotation', ['id_producer']);

$this->createIndex('user_fk', 'invoice', ['id_user']);
$this->createIndex('producer_fk', 'invoice', ['id_producer']);

$this->createIndex('delivery_note_fk', 'order', ['id_delivery_note']);
$this->createIndex('quotation_fk', 'order', ['id_quotation']);
$this->createIndex('invoice_fk', 'order', ['id_invoice']);
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropIndex('user_fk', 'delivery_note');
$this->dropIndex('producer_fk', 'delivery_note');

$this->dropIndex('user_fk', 'quotation');
$this->dropIndex('producer_fk', 'quotation');

$this->dropIndex('user_fk', 'invoice');
$this->dropIndex('producer_fk', 'invoice');

$this->dropIndex('delivery_note_fk', 'order');
$this->dropIndex('quotation_fk', 'order');
$this->dropIndex('invoice_fk', 'order');
}
}

Loading…
Отказ
Запис