drop old db tables and remove old functions

This commit is contained in:
padreug 2025-11-10 20:02:01 +01:00
parent 4220ff285e
commit 74115b7e5b
3 changed files with 43 additions and 390 deletions

View file

@ -628,3 +628,24 @@ async def m015_convert_to_single_amount_field(db):
CREATE INDEX idx_entry_lines_account ON entry_lines (account_id)
"""
)
async def m016_drop_obsolete_journal_tables(db):
"""
Drop journal_entries and entry_lines tables.
Castle now uses Fava/Beancount as the single source of truth for accounting data.
These tables are no longer written to or read from.
All journal entry operations now:
- Write: Submit to Fava via FavaClient.add_entry()
- Read: Query Fava via FavaClient.get_entries()
Migration completed as part of Castle extension cleanup (Nov 2025).
No backwards compatibility concerns - user explicitly approved.
"""
# Drop entry_lines first (has foreign key to journal_entries)
await db.execute("DROP TABLE IF EXISTS entry_lines")
# Drop journal_entries
await db.execute("DROP TABLE IF EXISTS journal_entries")