mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
228 lines
8.7 KiB
XML
228 lines
8.7 KiB
XML
<?xml version="1.0" 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-2.0.xsd">
|
|
|
|
<changeSet author="athou" id="drop-fes-index">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="index not found, skip drop index">
|
|
<indexExists tableName="FEEDENTRYSTATUSES" indexName="subscription_id" />
|
|
</preConditions>
|
|
<dropIndex tableName="FEEDENTRYSTATUSES" indexName="subscription_id" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="recreate-fes-index">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="index already exists">
|
|
<not>
|
|
<indexExists tableName="FEEDENTRYSTATUSES" indexName="sub_entry_read_index" />
|
|
</not>
|
|
</preConditions>
|
|
<createIndex indexName="sub_entry_read_index" tableName="FEEDENTRYSTATUSES"
|
|
unique="false">
|
|
<column name="subscription_id" />
|
|
<column name="entry_id" />
|
|
<column name="read_status" />
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="drop-sequences">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="table does not exist">
|
|
<tableExists tableName="hibernate_sequences" />
|
|
</preConditions>
|
|
<dropTable tableName="hibernate_sequences" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="recreate-sequences">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="table already exists">
|
|
<not>
|
|
<tableExists tableName="hibernate_sequences" />
|
|
</not>
|
|
</preConditions>
|
|
<createTable tableName="hibernate_sequences">
|
|
<column name="sequence_name" type="VARCHAR(255)" />
|
|
<column name="sequence_next_hi_value" type="INT" />
|
|
</createTable>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'APPLICATIONSETTINGS', COALESCE(ceil(max(id) / 1000 + 2), 1) from APPLICATIONSETTINGS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDCATEGORIES', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDCATEGORIES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRIES', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDENTRIES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRYCONTENTS', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDENTRYCONTENTS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRYSTATUSES', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDENTRYSTATUSES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDS', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDSUBSCRIPTIONS', COALESCE(ceil(max(id) / 1000 + 2), 1) from FEEDSUBSCRIPTIONS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERROLES', COALESCE(ceil(max(id) / 1000 + 2), 1) from USERROLES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERS', COALESCE(ceil(max(id) / 1000 + 2), 1) from USERS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERSETTINGS', COALESCE(ceil(max(id) / 1000 + 2), 1) from USERSETTINGS</sql>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-log-level">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="APPLICATIONSETTINGS"
|
|
columnName="logLevel" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="APPLICATIONSETTINGS">
|
|
<column name="logLevel" type="VARCHAR(255)" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-push-hub">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="pushHub" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="pushHub" type="VARCHAR(2048)" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-push-topic">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="pushTopic" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="pushTopic" type="VARCHAR(2048)" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-push-lastping">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="pushLastPing" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="pushLastPing" type="DATETIME" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-lastpublished">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="lastPublishedDate" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="lastPublishedDate" type="DATETIME" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-lastcontenthash">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="lastContentHash" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="lastContentHash" type="VARCHAR(40)" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-lastinterval">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="averageEntryInterval" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="averageEntryInterval" type="BIGINT" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-lastentrydate">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDS"
|
|
columnName="lastEntryDate" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="lastEntryDate" type="DATETIME" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-cat-position">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDCATEGORIES"
|
|
columnName="position" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDCATEGORIES">
|
|
<column name="position" type="INT" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-sub-position">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="column already exists">
|
|
<not>
|
|
<columnExists tableName="FEEDSUBSCRIPTIONS"
|
|
columnName="position" />
|
|
</not>
|
|
</preConditions>
|
|
<addColumn tableName="FEEDSUBSCRIPTIONS">
|
|
<column name="position" type="INT" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="drop-sequence">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="table does not exist">
|
|
<tableExists tableName="hibernate_sequence" />
|
|
</preConditions>
|
|
<dropTable tableName="hibernate_sequence" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="drop-old-pushinfos">
|
|
<preConditions onFail="MARK_RAN" onFailMessage="table does not exist">
|
|
<tableExists tableName="FEEDPUSHINFOS" />
|
|
</preConditions>
|
|
<dropTable tableName="FEEDPUSHINFOS" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-topic-hash">
|
|
<addColumn tableName="FEEDS">
|
|
<column name="push_topic_hash" type="VARCHAR(40)" />
|
|
</addColumn>
|
|
|
|
<createIndex tableName="FEEDS" indexName="push_topic_hash_index">
|
|
<column name="push_topic_hash"></column>
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-author">
|
|
<addColumn tableName="FEEDENTRIES">
|
|
<column name="author" type="VARCHAR(128)" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-inserted-index">
|
|
<createIndex tableName="FEEDENTRIES" indexName="inserted_index">
|
|
<column name="inserted"></column>
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="rename-lang">
|
|
<renameColumn tableName="USERSETTINGS" oldColumnName="language" newColumnName="user_lang" columnDataType="VARCHAR(4)" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="norwegian-migration">
|
|
<sql>update USERSETTINGS set user_lang='nb' where user_lang='no'</sql>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-user-created">
|
|
<addColumn tableName="USERS">
|
|
<column name="created" type="DATETIME" />
|
|
</addColumn>
|
|
<sql>update USERS set created = lastLogin</sql>
|
|
</changeSet>
|
|
|
|
</databaseChangeLog>
|