<commit_before><?php

use yii\db\Schema;
use yii\db\Migration;

class m151210_214415_create_product_categories_list_table extends Migration
{

    // Таблица "Список категорий товаров"
    // ID категории - первичный ключ integer
    // ID родительской категории - integer notNull (если категория наивысшего уровня, тогда ID = 0)
    // Название категории - varchar 255 notNull
    public function up()
    {
        $this->createTable('{{product_categories_list}}', [
            'category_id' => $this->primaryKey(),
            'parent_category_id' => $this->integer()->notNull(),
            'name' => $this->string()->notNull(),
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 1,
            'parent_category_id' => 0,
            'name' => 'category_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 2,
            'parent_category_id' => 0,
            'name' => 'category_2',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 3,
            'parent_category_id' => 0,
            'name' => 'category_3',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 4,
            'parent_category_id' => 0,
            'name' => 'category_4',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 5,
            'parent_category_id' => 1,
            'name' => 'category_1_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 6,
            'parent_category_id' => 5,
            'name' => 'category_1_1_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 7,
            'parent_category_id' => 1,
            'name' => 'category_1_2',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 8,
            'parent_category_id' => 7,
            'name' => 'category_1_2_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 9,
            'parent_category_id' => 2,
            'name' => 'category_2_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 10,
            'parent_category_id' => 2,
            'name' => 'category_2_2',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 11,
            'parent_category_id' => 3,
            'name' => 'category_3_1',
        ]);
        
        $this->insert('{{product_categories_list}}', [
            'category_id' => 12,
            'parent_category_id' => 11,
            'name' => 'category_3_1_1',
        ]);
    }

    public function down()
    {
        if ($this->db->schema->getTableSchema('{{product_categories_list}}', true) !== null) {
            $this->dropTable('{{product_categories_list}}');
        }
    }

}<commit_msg>test content fixed<commit_after><?php

use yii\db\Schema;
use yii\db\Migration;

class m151210_214415_create_product_categories_list_table extends Migration
{

    // Таблица "Список категорий товаров"
    // ID категории - первичный ключ integer
    // ID родительской категории - integer notNull (если категория наивысшего уровня, тогда ID = 0)
    // Название категории - varchar 255 notNull
    public function up()
    {
        $this->createTable('{{product_categories_list}}', [
            'category_id' => $this->primaryKey(),
            'parent_category_id' => $this->integer()->notNull(),
            'name' => $this->string()->notNull(),
        ]);

        $this->insert('{{product_categories_list}}', [
            'category_id' => 1,
            'parent_category_id' => 0,
            'name' => '1_Комплектующие',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 5,
            'parent_category_id' => 1,
            'name' => '1_1_Процессоры',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 6,
            'parent_category_id' => 5,
            'name' => '1_1_1_AMD',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 14,
            'parent_category_id' => 5,
            'name' => '1_1_2_Intel',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 7,
            'parent_category_id' => 1,
            'name' => '1_2_Видеокарты',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 13,
            'parent_category_id' => 7,
            'name' => '1_2_1_AMD',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 8,
            'parent_category_id' => 7,
            'name' => '1_2_2_Nvidia',
        ]);

        $this->insert('{{product_categories_list}}', [
            'category_id' => 2,
            'parent_category_id' => 0,
            'name' => '2_Бытовая техника',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 9,
            'parent_category_id' => 2,
            'name' => '2_1_Пылесосы',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 10,
            'parent_category_id' => 2,
            'name' => '2_2_Чайники',
        ]);

        $this->insert('{{product_categories_list}}', [
            'category_id' => 3,
            'parent_category_id' => 0,
            'name' => '3_Телефоны',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 11,
            'parent_category_id' => 3,
            'name' => '3_1_Смартфоны',
        ]);
        $this->insert('{{product_categories_list}}', [
            'category_id' => 12,
            'parent_category_id' => 11,
            'name' => '3_1_1_Android',
        ]);

        $this->insert('{{product_categories_list}}', [
            'category_id' => 4,
            'parent_category_id' => 0,
            'name' => '4_Ёлочные игрушки',
        ]);

    }

    public function down()
    {
        if ($this->db->schema->getTableSchema('{{product_categories_list}}', true) !== null) {
            $this->dropTable('{{product_categories_list}}');
        }
    }

}
{'fraction_non_alphanumeric': 0.16793183578621224, 'fraction_numerical': 0.022618125484120837, 'mean_word_length': 1.8617021276595744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7660355', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2080, 'n_words': 292}