ilp-kit
ilp-kit copied to clipboard
Way to truncate the logs
On Heroku Free Tier, only 10,000 database records are allowed, so it would be nice-to-have if the admin could click a button in the UI to truncate the history
Workaround:
- find the postgres URL in your heroku config
- From any computer that has the psql postgres client installed, run
psql <your-postgres-url> - pick a cut-off date for truncating the logs (for instance 21 February), and do:
DELETE FROM "L_TRANSFER_ADJUSTMENTS" WHERE "DB_CREATED_DTTM" < DATE('2017-02-21');
DELETE FROM "L_FULFILLMENTS" WHERE "DB_CREATED_DTTM" < DATE('2017-02-21');
DELETE FROM "L_ENTRIES" WHERE "DB_CREATED_DTTM" < DATE('2017-02-21');
DELETE FROM "L_TRANSFERS" WHERE "PROPOSED_DTTM" < DATE('2017-02-21');
VACUUM FULL;
\q
This worked for me to bring the database down from 7,000 to 2,000 records, and it seems my ilp-kit is still working. :)