summaryrefslogtreecommitdiff
path: root/src/main/resources/db/changeLog-1.4.xml
blob: 2e47dabe54eee61a0bc2acf1b794161e10a3de75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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.10.xsd">

  <changeSet author="mulk" id="1.3-1">
    <createTable tableName="post_texts" schemaName="benki">
      <column name="post" type="integer">
        <constraints
          nullable="false"
          primaryKeyName="post_texts_pkey"
          primaryKey="true"
          foreignKeyName="post_texts_post_fkey"
          referencedTableSchemaName="benki"
          referencedTableName="posts"
          referencedColumnNames="id"/>
      </column>

      <column name="language" type="varchar">
        <constraints
          nullable="false"
          primaryKeyName="lazychat_message_texts_pkey"
          primaryKey="true"
          checkConstraint="IN ('', 'de', 'en', 'fr', 'ja', 'la')"/>
      </column>
    </createTable>

    <renameColumn tableName="lazychat_message_texts" schemaName="benki" oldColumnName="lazychat_message" newColumnName="post"/>
    <renameColumn tableName="bookmark_texts" schemaName="benki" oldColumnName="bookmark" newColumnName="post"/>

    <sql>
      ALTER TABLE benki.lazychat_message_texts INHERIT benki.post_texts;
    </sql>

    <sql>
      ALTER TABLE benki.bookmark_texts INHERIT benki.post_texts;
    </sql>
  </changeSet>

</databaseChangeLog>