diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2021-01-30 14:43:39 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2021-01-30 14:43:39 +0100 |
commit | 67c6067083d491f7e239fe0d73a6ed16c637fb3b (patch) | |
tree | 5d98dfa415c3e97432e88f5135a5a583eed68c32 /src/main/resources | |
parent | 4712c1ded9eced00cf7a364d173a375cdfd4686e (diff) |
KB66 Post: Add scope field.
The scope field defines whether a post is a top-level post or a
comment and is used to select posts for the main feed.
Change-Id: I44363e3e67acbecff9844730a513ddb1d554afaf
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/db/changeLog-1.8.xml | 58 | ||||
-rw-r--r-- | src/main/resources/db/changeLog.xml | 1 |
2 files changed, 59 insertions, 0 deletions
diff --git a/src/main/resources/db/changeLog-1.8.xml b/src/main/resources/db/changeLog-1.8.xml new file mode 100644 index 0000000..2359001 --- /dev/null +++ b/src/main/resources/db/changeLog-1.8.xml @@ -0,0 +1,58 @@ +<?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.8-1"> + <sql> + CREATE TYPE benki.post_scope AS ENUM ('top_level', 'comment'); + </sql> + </changeSet> + + <changeSet author="mulk" id="1.8-2"> + <addColumn tableName="bookmarks" schemaName="benki"> + <column name="scope" type="benki.post_scope" defaultValue="top_level"> + <constraints nullable="false"/> + </column> + </addColumn> + + <addColumn tableName="lazychat_messages" schemaName="benki"> + <column name="scope" type="benki.post_scope" defaultValue="top_level"> + <constraints nullable="false"/> + </column> + </addColumn> + + <addColumn tableName="posts" schemaName="benki"> + <column name="scope" type="benki.post_scope" defaultValue="top_level"> + <constraints nullable="false"/> + </column> + </addColumn> + + <createIndex tableName="posts" + schemaName="benki" + indexName="post_scope_id_idx"> + <column name="scope"/> + <column name="id"/> + </createIndex> + </changeSet> + + <changeSet id="1.8-3" author="mulk"> + <createIndex tableName="bookmarks" + schemaName="benki" + indexName="bookmarks_scope_id_idx"> + <column name="scope"/> + <column name="id"/> + </createIndex> + + <createIndex tableName="lazychat_messages" + schemaName="benki" + indexName="lazychat_messages_scope_id_idx"> + <column name="scope"/> + <column name="id"/> + </createIndex> + </changeSet> + +</databaseChangeLog> diff --git a/src/main/resources/db/changeLog.xml b/src/main/resources/db/changeLog.xml index 7b4b700..88937a3 100644 --- a/src/main/resources/db/changeLog.xml +++ b/src/main/resources/db/changeLog.xml @@ -14,5 +14,6 @@ <include file="db/changeLog-1.5.xml"/> <include file="db/changeLog-1.6.xml"/> <include file="db/changeLog-1.7.xml"/> + <include file="db/changeLog-1.8.xml"/> </databaseChangeLog> |