mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
366 lines
14 KiB
XML
366 lines
14 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-3.0.xsd">
|
|
|
|
<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-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="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">
|
|
<validCheckSum>7:094e881ed7e4fa14fb1f61147ce44acc</validCheckSum>
|
|
<validCheckSum>7:f4bf2004a72bb41daa128df5771af902</validCheckSum>
|
|
<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(ceiling(max(id) / 1000 + 2), 1) from APPLICATIONSETTINGS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDCATEGORIES', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDCATEGORIES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRIES', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDENTRIES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRYCONTENTS', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDENTRYCONTENTS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDENTRYSTATUSES', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDENTRYSTATUSES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDS', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'FEEDSUBSCRIPTIONS', COALESCE(ceiling(max(id) / 1000 + 2), 1) from FEEDSUBSCRIPTIONS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERROLES', COALESCE(ceiling(max(id) / 1000 + 2), 1) from USERROLES</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERS', COALESCE(ceiling(max(id) / 1000 + 2), 1) from USERS</sql>
|
|
<sql>insert into hibernate_sequences(sequence_name, sequence_next_hi_value) select 'USERSETTINGS', COALESCE(ceiling(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">
|
|
<validCheckSum>3:b1bbf8d559ac25b785751704f2d24a91</validCheckSum>
|
|
<validCheckSum>7:5bd8b28aadce012b56f003539ce99957</validCheckSum>
|
|
<addColumn tableName="USERS">
|
|
<column name="created" type="DATETIME" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-proxy-setting">
|
|
<validCheckSum>7:ffca06665d2dc182bd3cb718e62e98f0</validCheckSum>
|
|
<addColumn tableName="APPLICATIONSETTINGS">
|
|
<column name="imageProxyEnabled" type="BIT" />
|
|
</addColumn>
|
|
<update tableName="APPLICATIONSETTINGS">
|
|
<column name="imageProxyEnabled" valueBoolean="false"></column>
|
|
</update>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-query-timeout-setting">
|
|
<addColumn tableName="APPLICATIONSETTINGS">
|
|
<column name="queryTimeout" type="INT" />
|
|
</addColumn>
|
|
<update tableName="APPLICATIONSETTINGS">
|
|
<column name="queryTimeout" valueNumeric="0"></column>
|
|
</update>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-normalized-url">
|
|
<addColumn tableName="FEEDS">
|
|
<column name="normalizedUrl" type="VARCHAR(2048)" />
|
|
</addColumn>
|
|
<addColumn tableName="FEEDS">
|
|
<column name="normalizedUrlHash" type="VARCHAR(40)" />
|
|
</addColumn>
|
|
<createIndex indexName="norm_url_hash_index" tableName="FEEDS"
|
|
unique="false">
|
|
<column name="normalizedUrlHash" />
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-pause-crawling">
|
|
<addColumn tableName="APPLICATIONSETTINGS">
|
|
<column name="crawlingPaused" type="BIT" />
|
|
</addColumn>
|
|
<update tableName="APPLICATIONSETTINGS">
|
|
<column name="crawlingPaused" valueBoolean="false"></column>
|
|
</update>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-content-hash-index">
|
|
<createIndex tableName="FEEDS" indexName="last_content_hash_index">
|
|
<column name="lastContentHash"></column>
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="create-settings-index">
|
|
<createIndex tableName="USERSETTINGS" indexName="user_id_index" unique="true">
|
|
<column name="user_id"></column>
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="denormalize-statuses">
|
|
<validCheckSum>7:c73f70fbcbc8bb30f9629028ec8ddb06</validCheckSum>
|
|
<addColumn tableName="FEEDENTRYSTATUSES">
|
|
<column name="user_id" type="BIGINT" defaultValue="1">
|
|
<constraints nullable="false" />
|
|
</column>
|
|
<column name="entryInserted" type="DATETIME" />
|
|
<column name="entryUpdated" type="DATETIME" />
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="populate-status-dates">
|
|
<validCheckSum>7:d6b5ab6920948b0a84e614870128e2f5</validCheckSum>
|
|
<sql>update FEEDENTRYSTATUSES SET entryUpdated = (select e.updated from FEEDENTRIES e where e.id = FEEDENTRYSTATUSES.entry_id)</sql>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="populate-status-users">
|
|
<validCheckSum>7:4227fdf2e7b9fe8e59544d536a7ee963</validCheckSum>
|
|
<sql>update FEEDENTRYSTATUSES SET user_id = (select sub.user_id from FEEDSUBSCRIPTIONS sub where sub.id = FEEDENTRYSTATUSES.subscription_id)</sql>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="recreate-fes-index-2">
|
|
<createIndex indexName="sub_entry_index" tableName="FEEDENTRYSTATUSES">
|
|
<column name="subscription_id" />
|
|
<column name="entry_id" />
|
|
</createIndex>
|
|
<createIndex indexName="sub_read_updated_index" tableName="FEEDENTRYSTATUSES">
|
|
<column name="subscription_id" />
|
|
<column name="read_status" />
|
|
<column name="entryUpdated" />
|
|
</createIndex>
|
|
<createIndex indexName="user_read_updated_index" tableName="FEEDENTRYSTATUSES">
|
|
<column name="user_id" />
|
|
<column name="read_status" />
|
|
<column name="entryUpdated" />
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="drop-fes-index-2">
|
|
<dropIndex tableName="FEEDENTRYSTATUSES" indexName="sub_entry_read_index" />
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-entry-updated-to-ffe">
|
|
<addColumn tableName="FEED_FEEDENTRIES">
|
|
<column name="entryUpdated" type="DATETIME"></column>
|
|
</addColumn>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="populate-entry-dates">
|
|
<sql>update FEED_FEEDENTRIES SET entryUpdated = (select e.updated from FEEDENTRIES e where e.id = FEED_FEEDENTRIES.feedentry_id)</sql>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="create-ffe-entry-updated-index">
|
|
<createIndex tableName="FEED_FEEDENTRIES" indexName="feed_updated_index">
|
|
<column name="FEED_ID"></column>
|
|
<column name="entryUpdated"></column>
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="create-count-index">
|
|
<createIndex indexName="user_read_sub_index" tableName="FEEDENTRYSTATUSES">
|
|
<column name="user_id" />
|
|
<column name="read_status" />
|
|
<column name="subscription_id" />
|
|
</createIndex>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="add-trim-status-setting">
|
|
<addColumn tableName="APPLICATIONSETTINGS">
|
|
<column name="keepStatusDays" type="INT" />
|
|
</addColumn>
|
|
<update tableName="APPLICATIONSETTINGS">
|
|
<column name="keepStatusDays" valueNumeric="0"></column>
|
|
</update>
|
|
</changeSet>
|
|
|
|
<changeSet author="athou" id="status-cleanup">
|
|
<delete tableName="FEEDENTRYSTATUSES">
|
|
<where>read_status = false and starred = false</where>
|
|
</delete>
|
|
</changeSet>
|
|
|
|
</databaseChangeLog>
|