<commit_before><?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                   http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">


    <changeSet id="adding-email_template-table" author="vova/jeroen">
        <createTable tableName="email_template">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="email_templates_pkey"/>
            </column>
            <column name="type" type="int"/>
            <column name="language" type="int"/>
            <column name="content" type="varchar(2048)"/>
            <column name="subject" type="varchar(1024)"/>
        </createTable>

        <addUniqueConstraint
                constraintName="email_template_type_language"
                columnNames="type, language"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="email_template"
        />
        <createIndex tableName="email_template" indexName="language_index">
            <column name="language"/>
        </createIndex>
        <createIndex tableName="email_template" indexName="type_index">
            <column name="type"/>
        </createIndex>
        <sql>
            INSERT INTO email_template VALUES(1, 0, 3, 'Task assigned to resource : Autogenerated content text', 'Autogenerated subject text');
        </sql>
    </changeSet>

    <changeSet id="adding-notification_notification_queue" author="vova">
        <createTable tableName="notification_queue">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="notification_queue_pkey"/>
            </column>
            <column name="type" type="int"/>
            <column name="updated" type="timestamp with time zone"/>
            <column name="resource" type="BIGINT"/>
            <column name="task" type="BIGINT"/>
            <column name="project" type="BIGINT"/>
        </createTable>
        <addUniqueConstraint
                tableName="notification_queue"
                columnNames="type, resource, task, project"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"/>
    </changeSet>

    <changeSet id="adding-issue_log-table" author="misha/vova">
        <createTable tableName="issue_log">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="issue_log_pkey"/>
            </column>
            <column name="code" type="varchar(25)"/>
            <column name="project" type="BIGINT"/>
            <column name="type" type="integer"/>
            <column name="description" type="varchar(512)"/>
            <column name="priority" type="integer"/>
            <column name="severity" type="integer"/>
            <column name="created_by" type="BIGINT"/>
            <column name="assigned_to" type="varchar(50)"/>
            <column name="status" type="varchar(50)"/>
            <column name="date_raised" type="timestamp with time zone"/>
            <column name="deadline" type="timestamp with time zone"/>
            <column name="date_resolved" type="timestamp with time zone"/>
            <column name="notes" type="varchar(256)"/>
        </createTable>

        <addForeignKeyConstraint baseTableName="issue_log" baseColumnNames="project"
                                 constraintName="issue_log_project_order_element_table"
                                 referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <addForeignKeyConstraint baseTableName="issue_log" baseColumnNames="created_by"
                                 constraintName="issue_log_user_user_table"
                                 referencedTableName="user_table"
                                 referencedColumnNames="id"/>
        <addUniqueConstraint
                constraintName="issue_log_unique_code"
                columnNames="code"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="issue_log"
        />
    </changeSet>

    <changeSet id="adding-risk_log-table" author="misha/vova">
        <createTable tableName="risk_log">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="risk_log_pkey"/>
            </column>
            <column name="code" type="varchar(25)"/>
            <column name="project" type="BIGINT"/>
            <column name="description" type="varchar(512)"/>
            <column name="probability" type="integer"/>
            <column name="impact" type="integer"/>
            <column name="score" type="integer"/>
            <column name="created_by" type="BIGINT"/>
            <column name="responsible" type="varchar(25)"/>
            <column name="status" type="varchar(25)"/>
            <column name="contingency" type="varchar(50)"/>
            <column name="counter_measures" type="varchar(50)"/>
            <column name="action_when" type="timestamp with time zone"/>
            <column name="date_created" type="timestamp with time zone"/>
            <column name="notes" type="varchar(256)"/>
        </createTable>
        <addForeignKeyConstraint baseTableName="risk_log" baseColumnNames="project"
                                 constraintName="project_order_element_table"
                                 referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <addForeignKeyConstraint baseTableName="risk_log" baseColumnNames="created_by"
                                 constraintName="risk_log_user_user_table"
                                 referencedTableName="user_table"
                                 referencedColumnNames="id"/>
        <addUniqueConstraint
                constraintName="risk_log_unique_code"
                columnNames="code"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="risk_log"
        />
    </changeSet>

    <changeSet id="adding-local-repository_location-to-configuration-table" author="vova">
        <addColumn tableName="configuration">
            <column name="repository_location" type="varchar(1024)" />
        </addColumn>
    </changeSet>

    <changeSet id="adding-files-table" author="vova/jeroen">
        <createTable tableName="files">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="files_pkey"/>
            </column>
            <column name="name" type="varchar(1024)"/>
            <column name="type" type="varchar(22)"/>
            <column name="date" type="timestamp with time zone"/>
            <column name="uploader" type="BIGINT"/>
            <column name="parent" type="BIGINT"/>
        </createTable>

        <addForeignKeyConstraint baseTableName="files" baseColumnNames="uploader"
                                 constraintName="files_uploader_fkey" referencedTableName="user_table"
                                 referencedColumnNames="id"/>

        <addForeignKeyConstraint baseTableName="files" baseColumnNames="parent"
                                 constraintName="files_parent_fkey" referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <sql>
            UPDATE configuration SET repository_location = '' WHERE id = 404;
        </sql>
    </changeSet>

</databaseChangeLog>
<commit_msg>Fixed trouble with failing changelogs on MySql<commit_after><?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                   http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">


    <changeSet id="adding-email_template-table" author="vova/jeroen">
        <createTable tableName="email_template">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="email_templates_pkey"/>
            </column>
            <column name="type" type="int"/>
            <column name="language" type="int"/>
            <column name="content" type="varchar(2048)"/>
            <column name="subject" type="varchar(1024)"/>
        </createTable>

        <addUniqueConstraint
                constraintName="email_template_type_language"
                columnNames="type, language"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="email_template"
        />
        <createIndex tableName="email_template" indexName="language_index">
            <column name="language"/>
        </createIndex>
        <createIndex tableName="email_template" indexName="type_index">
            <column name="type"/>
        </createIndex>
        <sql>
            INSERT INTO email_template VALUES(1, 0, 3, 'Task assigned to resource : Autogenerated content text', 'Autogenerated subject text');
        </sql>
    </changeSet>

    <changeSet id="adding-notification_notification_queue" author="vova">
        <createTable tableName="notification_queue">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="notification_queue_pkey"/>
            </column>
            <column name="type" type="int"/>
            <column name="updated" type="timestamp"/>
            <column name="resource" type="BIGINT"/>
            <column name="task" type="BIGINT"/>
            <column name="project" type="BIGINT"/>
        </createTable>
        <addUniqueConstraint
                tableName="notification_queue"
                columnNames="type, resource, task, project"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"/>
    </changeSet>

    <changeSet id="adding-issue_log-table" author="misha/vova">
        <createTable tableName="issue_log">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="issue_log_pkey"/>
            </column>
            <column name="code" type="varchar(25)"/>
            <column name="project" type="BIGINT"/>
            <column name="type" type="integer"/>
            <column name="description" type="varchar(512)"/>
            <column name="priority" type="integer"/>
            <column name="severity" type="integer"/>
            <column name="created_by" type="BIGINT"/>
            <column name="assigned_to" type="varchar(50)"/>
            <column name="status" type="varchar(50)"/>
            <column name="date_raised" type="timestamp"/>
            <column name="deadline" type="timestamp"/>
            <column name="date_resolved" type="timestamp"/>
            <column name="notes" type="varchar(256)"/>
        </createTable>

        <addForeignKeyConstraint baseTableName="issue_log" baseColumnNames="project"
                                 constraintName="issue_log_project_order_element_table"
                                 referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <addForeignKeyConstraint baseTableName="issue_log" baseColumnNames="created_by"
                                 constraintName="issue_log_user_user_table"
                                 referencedTableName="user_table"
                                 referencedColumnNames="id"/>
        <addUniqueConstraint
                constraintName="issue_log_unique_code"
                columnNames="code"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="issue_log"
        />
    </changeSet>

    <changeSet id="adding-risk_log-table" author="misha/vova">
        <createTable tableName="risk_log">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="risk_log_pkey"/>
            </column>
            <column name="code" type="varchar(25)"/>
            <column name="project" type="BIGINT"/>
            <column name="description" type="varchar(512)"/>
            <column name="probability" type="integer"/>
            <column name="impact" type="integer"/>
            <column name="score" type="integer"/>
            <column name="created_by" type="BIGINT"/>
            <column name="responsible" type="varchar(25)"/>
            <column name="status" type="varchar(25)"/>
            <column name="contingency" type="varchar(50)"/>
            <column name="counter_measures" type="varchar(50)"/>
            <column name="action_when" type="timestamp"/>
            <column name="date_created" type="timestamp"/>
            <column name="notes" type="varchar(256)"/>
        </createTable>
        <addForeignKeyConstraint baseTableName="risk_log" baseColumnNames="project"
                                 constraintName="project_order_element_table"
                                 referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <addForeignKeyConstraint baseTableName="risk_log" baseColumnNames="created_by"
                                 constraintName="risk_log_user_user_table"
                                 referencedTableName="user_table"
                                 referencedColumnNames="id"/>
        <addUniqueConstraint
                constraintName="risk_log_unique_code"
                columnNames="code"
                deferrable="false"
                disabled="false"
                initiallyDeferred="false"
                tableName="risk_log"
        />
    </changeSet>

    <changeSet id="adding-local-repository_location-to-configuration-table" author="vova">
        <addColumn tableName="configuration">
            <column name="repository_location" type="varchar(1024)" />
        </addColumn>
    </changeSet>

    <changeSet id="adding-files-table" author="vova/jeroen">
        <createTable tableName="files">
            <column name="id" type="BIGINT" autoIncrement="true">
                <constraints primaryKey="true" nullable="false" primaryKeyName="files_pkey"/>
            </column>
            <column name="name" type="varchar(1024)"/>
            <column name="type" type="varchar(22)"/>
            <column name="date" type="timestamp"/>
            <column name="uploader" type="BIGINT"/>
            <column name="parent" type="BIGINT"/>
        </createTable>

        <addForeignKeyConstraint baseTableName="files" baseColumnNames="uploader"
                                 constraintName="files_uploader_fkey" referencedTableName="user_table"
                                 referencedColumnNames="id"/>

        <addForeignKeyConstraint baseTableName="files" baseColumnNames="parent"
                                 constraintName="files_parent_fkey" referencedTableName="order_element"
                                 referencedColumnNames="id"/>
        <sql>
            UPDATE configuration SET repository_location = '' WHERE id = 404;
        </sql>
    </changeSet>

</databaseChangeLog>

{'fraction_non_alphanumeric': 0.12479618713156905, 'fraction_numerical': 0.007776244826288725, 'mean_word_length': 2.1741640127388533, 'pattern_counts': {'":': 0, '<': 211, '<?xml version=': 2, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '934386', 'n_tokens_mistral': 4239, 'n_tokens_neox': 4054, 'n_words': 683}