HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux dev1 5.15.83-1-pve #1 SMP PVE 5.15.83-1 (2022-12-15T00:00Z) x86_64
User: safarimaris (1000)
PHP: 7.2.34-54+ubuntu22.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /home/safarimaris/home/safarimaris/console/migrations/m161114_123308_country_descr.php
<?php

use yii\db\Migration;

class m161114_123308_country_descr extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
        $this->createTable('{{%setting}}', [
            'idx' => $this->primaryKey(),
            'value' => $this->string()->notNull()
        ], $tableOptions);
        $this->alterColumn('{{%setting}}', 'idx', $this->string());

        $this->batchInsert('{{%setting}}', ['idx', 'value'], [
            ['rateEuro', '0,9210'],
            ['rateUah', '25,6350'],
            ['indexTitle1', 'Опытная команда и проверенные партнеры'],
            ['indexText1', 'За 9 лет нашей работы наши клиенты объездили весь мир. На основании большого потока свежих отзывов и собственных знаний мы тщательно отбираем принимающие стороны, анализируем и запоминаем все детали и нюансы путешествий.'],
            ['indexTitle2', 'Лучшая цена'],
            ['indexText2', 'Мы гарантируем лучшую цену на представленные туры как для дайверов, так и для организаторов групповых поездок: клубов и инструкторов'],
            ['indexTitle3', 'Сопровождении в туре 24/7'],
            ['indexText3', 'Мы всегда на связи с вами, и с принимающей стороной. Одна из самых важных сторон нашей работы - поддержка клиентов во время тура и помощь в решении любых сложных ситуациях.'],
            ['indexTitle4', 'Бесплатная медицинская поддержка DAN'],
            ['indexText4', 'Все клиенты Сафари Марис, которые отправляются на дайвинг-сафари, обеспечены бесплатной дайвинг-страховкой с медицинской поддержкой DAN']
        ]);

        $this->addColumn('{{%country}}', 'descr', $this->string());
        $this->addColumn('{{%tag}}', 'ordinal', $this->string());
        $this->addColumn('{{%entity}}', 'price', $this->decimal(10, 2));
        $this->createIndex('IDX_tag_ordinal', '{{%tag}}', 'ordinal, name');
        $this->createIndex('IDX_country_ordinal', '{{%country}}', 'ordinal, name');
        $this->createIndex('IDX_entity_ordinal', '{{%entity}}', 'ordinal, name');
        $this->createIndex('IDX_region_ordinal', '{{%region}}', 'ordinal, name');
        $this->createIndex('IDX_special_ordinal', '{{%special}}', 'ordinal, title');


    }

    public function down()
    {
        $this->dropTable('{{%setting}}');
        $this->dropColumn('{{%country}}', 'descr');
        $this->dropColumn('{{%tag}}', 'ordinal');
        $this->dropColumn('{{%entity}}', 'price');
        $this->dropIndex('IDX_tag_ordinal', '{{%tag}}');
        $this->dropIndex('IDX_country_ordinal', '{{%country}}');
        $this->dropIndex('IDX_entity_ordinal', '{{%entity}}');
        $this->dropIndex('IDX_region_ordinal', '{{%region}}');
        $this->dropIndex('IDX_special_ordinal', '{{%special}}');
    }
}