delete old statuses

This commit is contained in:
Athou
2013-07-23 15:27:56 +02:00
parent 074ecbf159
commit 150920e0c8
10 changed files with 120 additions and 37 deletions

View File

@@ -4,21 +4,9 @@
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<named-query name="EntryStatus.unreadCounts">
<query>select s.subscription.id, count(s) from FeedEntryStatus s where s.user=:user and s.read=false group by s.subscription.id</query>
<named-query name="Statuses.deleteOld">
<query>delete from FeedEntryStatus s where s.entryInserted &lt; :date and s.starred = false</query>
</named-query>
<named-query name="EntryStatus.existing">
<query>select new com.commafeed.backend.dao.FeedEntryDAO$EntryWithFeed(e, f) FROM FeedEntry e LEFT JOIN e.feedRelationships f WITH f.feed.id = :feedId where e.guidHash = :guidHash and e.url = :url</query>
</named-query>
<named-query name="EntryStatus.deleteByIds">
<query>delete from FeedEntryStatus s where s.id in :ids</query>
</named-query>
<named-query name="Feed.deleteEntryRelationships">
<query>delete from FeedFeedEntry ffe where ffe.feed.id = :feedId</query>
</named-query>
</entity-mappings>

View File

@@ -346,4 +346,13 @@
<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>
</databaseChangeLog>