<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.0.xsd">

    <changeSet id="000-HibernateSequence"
               author="<NAME> [<EMAIL>]">

        <createSequence sequenceName="HIBERNATE_SEQUENCE" />

    </changeSet>

    <changeSet id="001-LocationFact"
               author="<NAME> [<EMAIL>]">

        <createTable tableName="LOCATION_FACT">
            <column name="ID"
                    type="BIGINT">
                <constraints primaryKey="true"/>
            </column>
            <column name="REVISION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="CONTINENT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="COUNTRY"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SUBDIVISION"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="CITY"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_PEOPLE"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_DURATION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_DURATION_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_CODE"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SUMMARY_DURATION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="SUMMARY_DURATION_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SOURCE"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>

        </createTable>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CITY_SUBDIVISION_COUNTRY_CONTINENT"
                     unique="true">
            <column name="CITY"/>
            <column name="SUBDIVISION"/>
            <column name="COUNTRY"/>
            <column name="CONTINENT"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CITY">
            <column name="CITY"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_COUNTRY">
            <column name="COUNTRY"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CONTINENT">
            <column name="CONTINENT"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_SUBDIVISION">
            <column name="SUBDIVISION"/>
        </createIndex>

        </changeSet>

    <changeSet id="002-LocationFact-Data"
               author="<NAME> [<EMAIL>]">

        <loadData tableName="LOCATION_FACT"
                  file="liquibase/data/location-facts.csv"/>

    </changeSet>

</databaseChangeLog><commit_msg>Updated ID generation and added User and UserConnection tables<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.0.xsd">

    <changeSet id="001-LocationFact"
               author="<NAME> [<EMAIL>]">

        <createTable tableName="LOCATION_FACT">
            <column name="ID"
                    type="BIGINT"
                    autoIncrement="true"
                    startWith="1">
                <constraints primaryKey="true"/>
            </column>
            <column name="REVISION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="CONTINENT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="COUNTRY"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SUBDIVISION"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="CITY"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_PEOPLE"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_DURATION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_DURATION_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="TASK_CODE"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SUMMARY_DURATION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="SUMMARY_DURATION_TIME_UNIT"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SOURCE"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>

        </createTable>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CITY_SUBDIVISION_COUNTRY_CONTINENT"
                     unique="true">
            <column name="CITY"/>
            <column name="SUBDIVISION"/>
            <column name="COUNTRY"/>
            <column name="CONTINENT"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CITY">
            <column name="CITY"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_COUNTRY">
            <column name="COUNTRY"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_CONTINENT">
            <column name="CONTINENT"/>
        </createIndex>

        <createIndex tableName="LOCATION_FACT"
                     indexName="IDX_LOCATION_FACT_SUBDIVISION">
            <column name="SUBDIVISION"/>
        </createIndex>

    </changeSet>

    <changeSet id="002-LocationFact-Data"
               author="<NAME> [<EMAIL>]">

        <loadData tableName="LOCATION_FACT"
                  file="liquibase/data/location-facts.csv"/>

    </changeSet>

    <changeSet id="004-User"
               author="<NAME> [<EMAIL>]">

        <createTable tableName="USER">
            <column name="ID"
                    type="BIGINT"
                    autoIncrement="true"
                    startWith="1">
                <constraints primaryKey="true"/>
            </column>
            <column name="REVISION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="EMAIL"
                    type="VARCHAR"/>
            <column name="FIRST_NAME"
                    type="VARCHAR"/>
            <column name="LAST_NAME"
                    type="VARCHAR"/>
            <column name="NAME"
                    type="VARCHAR"/>
            <column name="USERNAME"
                    type="VARCHAR"/>
        </createTable>

    </changeSet>

    <changeSet id="005-UserConnection"
               author="<NAME> [<EMAIL>]">

        <createTable tableName="USER_CONNECTION">
            <column name="ID"
                    type="BIGINT"
                    autoIncrement="true"
                    startWith="1">
                <constraints primaryKey="true"/>
            </column>
            <column name="REVISION"
                    type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="USER_ID"
                    type="BIGINT">
            </column>
            <column name="PROVIDER_ID"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="PROVIDER_USER_ID"
                    type="VARCHAR"/>
            <column name="RANK"
                    type="INTEGER"/>
            <column name="DISPLAY_NAME"
                    type="VARCHAR"/>
            <column name="PROFILE_URL"
                    type="VARCHAR"/>
            <column name="IMAGE_URL"
                    type="VARCHAR"/>
            <column name="ACCESS_TOKEN"
                    type="VARCHAR">
                <constraints nullable="false"/>
            </column>
            <column name="SECRET"
                    type="VARCHAR"/>
            <column name="REFRESH_TOKEN"
                    type="VARCHAR"/>
            <column name="EXPIRE_TIME"
                    type="BIGINT"/>
        </createTable>

        <addForeignKeyConstraint baseColumnNames="USER_ID"
                                 baseTableName="USER_CONNECTION"
                                 constraintName="FK_USER_CONNECTION_USER_ID"
                                 deleteCascade="true"
                                 referencedColumnNames="ID"
                                 referencedTableName="USER"/>

        <createIndex tableName="USER_CONNECTION"
                     indexName="IDX_USER_CONNECTION_USER_ID_PROVIDER_ID_PROVIDER_USER_ID"
                     unique="true">
            <column name="USER_ID"/>
            <column name="PROVIDER_ID"/>
            <column name="PROVIDER_USER_ID"/>
        </createIndex>

        <createIndex tableName="USER_CONNECTION"
                     indexName="IDX_USER_CONNECTION_USER_ID_PROVIDER_ID_RANK"
                     unique="true">
            <column name="USER_ID"/>
            <column name="PROVIDER_ID"/>
            <column name="RANK"/>
        </createIndex>

    </changeSet>

</databaseChangeLog>
{'fraction_non_alphanumeric': 0.11912974263730433, 'fraction_numerical': 0.0038913947112408243, 'mean_word_length': 1.4344456404736277, 'pattern_counts': {'":': 0, '<': 212, '<?xml version=': 2, '>': 212, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1073032', 'n_tokens_mistral': 3106, 'n_tokens_neox': 2892, 'n_words': 436}