ilp-kit icon indicating copy to clipboard operation
ilp-kit copied to clipboard

Way to truncate the logs

Open michielbdejong opened this issue 8 years ago • 1 comments

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

michielbdejong avatar Feb 21 '17 12:02 michielbdejong

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. :)

michielbdejong avatar Feb 21 '17 13:02 michielbdejong