Make the messagedb a bounded queue at 5000 msgs/device
// FREEBIE
This commit is contained in:
parent
2902ea6689
commit
8b941ddd33
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue