Make the messagedb a bounded queue at 5000 msgs/device

// FREEBIE
This commit is contained in:
Moxie Marlinspike committed 2015-08-18 11:10:42 -07:00
1 parent 2902ea6689
commit 8b941ddd33
1 file changed
+4
+4
View File
@@ -65,4 +65,8 @@
<dropNotNullConstraint tableName="messages" columnName="message"/>
</changeSet>
<changeSet id="3" author="moxie">
<sql>CREATE RULE bounded_message_queue AS ON INSERT TO messages DO ALSO DELETE FROM messages WHERE id IN (SELECT id FROM messages WHERE destination = NEW.destination AND destination_device = NEW.destination_device ORDER BY timestamp DESC OFFSET 5000);</sql>
</changeSet>
</databaseChangeLog>