123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420 |
- <?xml version="1.1" encoding="UTF-8" standalone="no"?>
- <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
- <changeSet author="dsm (generated)" id="1710759291530-1">
- <createTable tableName="admin_user">
- <column name="username" type="VARCHAR(100)">
- <constraints nullable="false" unique="true"/>
- </column>
- <column name="password" type="VARCHAR(100)">
- <constraints nullable="false"/>
- </column>
- <column name="created_time" type="timestamp"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-2">
- <createTable tableName="blog">
- <column name="blog_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="user_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="created_time" type="timestamp"/>
- <column name="last_update_time" type="timestamp"/>
- <column name="title" type="VARCHAR(200)"/>
- <column name="head_image_url" type="VARCHAR(500)"/>
- <column name="language" type="VARCHAR(50)"/>
- <column name="content" type="LONGTEXT"/>
- <column defaultValue="0" name="draft" type="BIT(1)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-3">
- <createTable tableName="comment">
- <column name="comment_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="user_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="blog_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="created_time" type="timestamp"/>
- <column name="respond_to" type="VARCHAR(50)"/>
- <column name="comment_content" type="TEXT"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-4">
- <createTable tableName="destination">
- <column name="destination_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="destination_name" type="VARCHAR(500)"/>
- <column name="level" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="parent_id" type="VARCHAR(50)"/>
- <column name="description" type="TEXT"/>
- <column name="created_date" type="timestamp"/>
- <column name="destination_profile_image" type="VARCHAR(500)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-5">
- <createTable tableName="guidebook">
- <column name="guide_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="download_url" type="VARCHAR(500)"/>
- <column name="cover_image_url" type="VARCHAR(500)"/>
- <column name="short_description" type="VARCHAR(300)"/>
- <column name="destination_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="created_date" type="timestamp"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-6">
- <createTable tableName="hichina_line">
- <column autoIncrement="true" name="id" type="BIGINT">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="public_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="name" type="VARCHAR(300)">
- <constraints nullable="false"/>
- </column>
- <column name="created_date" type="timestamp"/>
- <column name="icon_path" type="VARCHAR(300)"/>
- <column name="range_in_days" type="INT"/>
- <column name="base_price" type="FLOAT(12)"/>
- <column name="description" type="TEXT"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-7">
- <createTable tableName="hichina_product">
- <column name="sku_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="sku_group_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="product_type_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="product_name" type="VARCHAR(500)"/>
- <column name="product_content" type="TEXT"/>
- <column name="created_time" type="timestamp"/>
- <column name="created_by" type="VARCHAR(100)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-8">
- <createTable tableName="hichina_product_type">
- <column name="product_type_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="product_type_name" type="VARCHAR(50)">
- <constraints nullable="false" unique="true"/>
- </column>
- <column name="product_type_description" type="VARCHAR(100)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-9">
- <createTable tableName="order">
- <column name="order_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="user_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="product_sku_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column defaultValueComputed="CURRENT_TIMESTAMP" name="created_time" type="timestamp">
- <constraints nullable="false"/>
- </column>
- <column name="last_update_time" type="timestamp"/>
- <column name="meta" type="TEXT"/>
- <column name="status" type="VARCHAR(50)"/>
- <column name="paying_info" type="VARCHAR(500)"/>
- <column name="price" type="INT"/>
- <column name="remark" type="VARCHAR(500)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-10">
- <createTable tableName="product_attribute">
- <column name="attribute_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="attribute_name" type="VARCHAR(50)">
- <constraints nullable="false" unique="true"/>
- </column>
- <column name="data_type" type="VARCHAR(20)">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-11">
- <createTable tableName="product_sku_group">
- <column name="sku_group_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="sku_group_name" type="VARCHAR(500)"/>
- <column name="product_type_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="created_date" type="timestamp"/>
- <column defaultValue="0" name="enabled" type="BIT(1)"/>
- <column name="image_url" type="VARCHAR(500)"/>
- <column name="min_price" type="INT"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-12">
- <createTable tableName="product_sku_group_destination_mapping">
- <column name="product_sku_group_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="destination_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-13">
- <createTable tableName="product_sku_int_attribute_mapping">
- <column name="sku_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="data_type" type="VARCHAR(20)"/>
- <column name="attribute_value" type="INT"/>
- <column name="attribute_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-14">
- <createTable tableName="product_sku_timestamp_attribute_mapping">
- <column name="sku_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="data_type" type="VARCHAR(20)"/>
- <column name="attribute_value" type="timestamp"/>
- <column name="attribute_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-15">
- <createTable tableName="product_sku_varchar_attribute_mapping">
- <column name="sku_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="data_type" type="VARCHAR(20)"/>
- <column name="attribute_value" type="TEXT"/>
- <column name="attribute_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-16">
- <createTable tableName="product_type_attribute_mapping">
- <column name="product_type_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="attribute_id" type="VARCHAR(50)">
- <constraints nullable="false"/>
- </column>
- <column name="sequence" type="BIGINT">
- <constraints nullable="false"/>
- </column>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-17">
- <createTable tableName="user">
- <column name="user_id" type="VARCHAR(50)">
- <constraints nullable="false" primaryKey="true"/>
- </column>
- <column name="salt" type="VARCHAR(100)">
- <constraints nullable="false"/>
- </column>
- <column name="password" type="VARCHAR(500)">
- <constraints nullable="false"/>
- </column>
- <column defaultValueComputed="CURRENT_TIMESTAMP" name="created_time" type="timestamp">
- <constraints nullable="false"/>
- </column>
- <column name="email" type="VARCHAR(100)">
- <constraints unique="true"/>
- </column>
- <column name="facebook_id" type="VARCHAR(100)">
- <constraints unique="true"/>
- </column>
- <column name="google_id" type="VARCHAR(100)">
- <constraints unique="true"/>
- </column>
- <column name="wx_id" type="VARCHAR(100)">
- <constraints unique="true"/>
- </column>
- <column name="phone" type="VARCHAR(100)">
- <constraints unique="true"/>
- </column>
- <column name="username" type="VARCHAR(100)"/>
- <column name="gender" type="INT"/>
- <column name="birth_date" type="timestamp"/>
- <column name="nationality" type="VARCHAR(100)"/>
- <column name="license_type" type="VARCHAR(50)"/>
- <column name="license_number" type="VARCHAR(100)"/>
- <column name="license_sign_date" type="timestamp"/>
- <column name="license_expire_date" type="timestamp"/>
- <column name="signature" type="VARCHAR(200)"/>
- <column name="profile_image_url" type="VARCHAR(500)"/>
- <column name="passport_image_url" type="VARCHAR(500)"/>
- <column name="pwd_code" type="INT"/>
- <column name="login_type" type="VARCHAR(100)"/>
- </createTable>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-18">
- <addUniqueConstraint columnNames="guide_id, destination_id" constraintName="guidebookanddestinationoneonemapping" tableName="guidebook"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-19">
- <addUniqueConstraint columnNames="product_type_id, attribute_id" constraintName="product_type_attribute_binding_unique" tableName="product_type_attribute_mapping"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-20">
- <addUniqueConstraint columnNames="sku_id, attribute_id" constraintName="sku_id_single_attribute_int_value" tableName="product_sku_int_attribute_mapping"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-21">
- <addUniqueConstraint columnNames="sku_id, attribute_id" constraintName="sku_id_single_attribute_timestamp_value" tableName="product_sku_timestamp_attribute_mapping"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-22">
- <addUniqueConstraint columnNames="sku_id, attribute_id" constraintName="sku_id_single_attribute_varchar_value" tableName="product_sku_varchar_attribute_mapping"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-23">
- <addUniqueConstraint columnNames="sku_group_name, product_type_id" constraintName="unique_sku_group_name_within_same_product_type" tableName="product_sku_group"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-24">
- <addUniqueConstraint columnNames="product_sku_group_id, destination_id" constraintName="uniquebindingofskugroupidanddestinationid" tableName="product_sku_group_destination_mapping"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-25">
- <createIndex associatedWith="" indexName="fk_blog_to_user_id" tableName="blog">
- <column name="user_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-26">
- <createIndex associatedWith="" indexName="fk_comment_to_blog_id" tableName="comment">
- <column name="blog_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-27">
- <createIndex associatedWith="" indexName="fk_comment_to_comment_id" tableName="comment">
- <column name="respond_to"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-28">
- <createIndex associatedWith="" indexName="fk_comment_to_user_id" tableName="comment">
- <column name="user_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-29">
- <createIndex associatedWith="" indexName="fk_destination_to_destination_id" tableName="destination">
- <column name="parent_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-30">
- <createIndex associatedWith="" indexName="fk_guidebook_to_destination_id" tableName="guidebook">
- <column name="destination_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-31">
- <createIndex associatedWith="" indexName="fk_order_to_product_sku_id" tableName="order">
- <column name="product_sku_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-32">
- <createIndex associatedWith="" indexName="fk_order_to_user_id" tableName="order">
- <column name="user_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-33">
- <createIndex associatedWith="" indexName="fk_prd_att_mapping_to_attr_id" tableName="product_type_attribute_mapping">
- <column name="attribute_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-34">
- <createIndex associatedWith="" indexName="fk_prd_att_mapping_to_product_type_id" tableName="product_type_attribute_mapping">
- <column name="product_type_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-35">
- <createIndex associatedWith="" indexName="fk_product_to_sku_group_group_id" tableName="hichina_product">
- <column name="sku_group_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-36">
- <createIndex associatedWith="" indexName="fk_product_to_type_type_id" tableName="hichina_product">
- <column name="product_type_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-37">
- <createIndex associatedWith="" indexName="fk_sku_group_to_product_type_id" tableName="product_sku_group">
- <column name="product_type_id"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-38">
- <createIndex associatedWith="" indexName="index_publicid" tableName="hichina_line">
- <column name="public_id"/>
- <column name="name"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-39">
- <createIndex associatedWith="" indexName="indexblogcreatetime" tableName="blog">
- <column name="created_time"/>
- </createIndex>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-40">
- <addForeignKeyConstraint baseColumnNames="user_id" baseTableName="blog" constraintName="fk_blog_to_user_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="user_id" referencedTableName="user" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-41">
- <addForeignKeyConstraint baseColumnNames="blog_id" baseTableName="comment" constraintName="fk_comment_to_blog_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="blog_id" referencedTableName="blog" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-42">
- <addForeignKeyConstraint baseColumnNames="respond_to" baseTableName="comment" constraintName="fk_comment_to_comment_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="comment_id" referencedTableName="comment" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-43">
- <addForeignKeyConstraint baseColumnNames="user_id" baseTableName="comment" constraintName="fk_comment_to_user_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="user_id" referencedTableName="user" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-44">
- <addForeignKeyConstraint baseColumnNames="parent_id" baseTableName="destination" constraintName="fk_destination_to_destination_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="destination_id" referencedTableName="destination" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-45">
- <addForeignKeyConstraint baseColumnNames="destination_id" baseTableName="guidebook" constraintName="fk_guidebook_to_destination_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="destination_id" referencedTableName="destination" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-46">
- <addForeignKeyConstraint baseColumnNames="product_sku_id" baseTableName="order" constraintName="fk_order_to_product_sku_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="sku_id" referencedTableName="hichina_product" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-47">
- <addForeignKeyConstraint baseColumnNames="user_id" baseTableName="order" constraintName="fk_order_to_user_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="user_id" referencedTableName="user" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-48">
- <addForeignKeyConstraint baseColumnNames="attribute_id" baseTableName="product_type_attribute_mapping" constraintName="fk_prd_att_mapping_to_attr_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="attribute_id" referencedTableName="product_attribute" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-49">
- <addForeignKeyConstraint baseColumnNames="product_type_id" baseTableName="product_type_attribute_mapping" constraintName="fk_prd_att_mapping_to_product_type_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="product_type_id" referencedTableName="hichina_product_type" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-50">
- <addForeignKeyConstraint baseColumnNames="sku_group_id" baseTableName="hichina_product" constraintName="fk_product_to_sku_group_group_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="sku_group_id" referencedTableName="product_sku_group" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-51">
- <addForeignKeyConstraint baseColumnNames="product_type_id" baseTableName="hichina_product" constraintName="fk_product_to_type_type_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="product_type_id" referencedTableName="hichina_product_type" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-52">
- <addForeignKeyConstraint baseColumnNames="product_type_id" baseTableName="product_sku_group" constraintName="fk_sku_group_to_product_type_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="product_type_id" referencedTableName="hichina_product_type" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-53">
- <addForeignKeyConstraint baseColumnNames="sku_id" baseTableName="product_sku_int_attribute_mapping" constraintName="fk_skuintattrmapping_to_product_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="sku_id" referencedTableName="hichina_product" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-54">
- <addForeignKeyConstraint baseColumnNames="sku_id" baseTableName="product_sku_timestamp_attribute_mapping" constraintName="fk_skutimestampattrmapping_to_product_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="sku_id" referencedTableName="hichina_product" validate="true"/>
- </changeSet>
- <changeSet author="dsm (generated)" id="1710759291530-55">
- <addForeignKeyConstraint baseColumnNames="sku_id" baseTableName="product_sku_varchar_attribute_mapping" constraintName="fk_skuvarcharattrmapping_to_product_id" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="sku_id" referencedTableName="hichina_product" validate="true"/>
- </changeSet>
- </databaseChangeLog>
|