portal.mkgtu.ru/common/migrations/db/m220430_081712_add_text_set...

70 lines
2.5 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use common\components\Migration\MigrationWithDefaultOptions;
use common\models\settings\TextSetting;
class m220430_081712_add_text_settings extends MigrationWithDefaultOptions
{
public function safeUp()
{
$this->delete(
'{{%text_settings}}',
['name' => [
'text_for_sets_when_failed_to_collect_with_completed_profile',
'text_for_sets_when_failed_to_collect_with_a_not_filled_profile',
]]
);
$this->insert(
'{{%text_settings}}',
[
'name' => 'text_for_an_empty_line_when_it_was_not_possible_to_collect_a_set_of_entrance_tests',
'description' => 'Текст для пустой строки, когда не удалось собрать набора ВИ',
'value' => 'Не удалось собрать набор вступительных испытаний',
'category' => TextSetting::CATEGORY_EXAMS
]
);
Yii::$app->db->schema->refresh();
}
public function safeDown()
{
$this->delete(
'{{%text_settings}}',
['name' => 'text_for_an_empty_line_when_it_was_not_possible_to_collect_a_set_of_entrance_tests']
);
$this->insert(
'{{%text_settings}}',
[
'name' => 'text_for_sets_when_failed_to_collect_with_completed_profile',
'description' => 'Текст для пустой строки набора ВИ, когда не удалось собрать с заполненным профилем',
'value' => 'Не удалось собрать набор вступительных испытаний по указанным профилям образования',
'category' => TextSetting::CATEGORY_EXAMS
]
);
$this->insert(
'{{%text_settings}}',
[
'name' => 'text_for_sets_when_failed_to_collect_with_a_not_filled_profile',
'description' => 'Текст для пустой строки набора ВИ, когда не удалось собрать с не заполненным профилем',
'value' => 'Не удалось собрать набор вступительных испытаний',
'category' => TextSetting::CATEGORY_EXAMS
]
);
Yii::$app->db->schema->refresh();
}
}