-- 026_accounting_api_keys.down.sql
-- Rollback documentation for 026_accounting_api_keys.sql.
-- Documentation only — archivdms has no migration runner; this file is the
-- reviewed, copy-pasteable SQL an operator runs manually (psql) AFTER
-- deploying a binary whose initSchema no longer creates the object, and
-- inside an explicit transaction.
--
-- PRECONDITION: internal/storage/accounting_api_keys.go
-- (Store.initAccountingAPIKeysSchema) must be removed from storage.New()
-- first — otherwise the next process start recreates the table.
--
-- DATA LOSS: destroys all issued accounting API keys (hashes only, raw keys
-- were never stored). Every buchhaltung integration using the Pull-API loses
-- access and must be re-issued a new key. No GoBD document data is touched:
-- accounting_api_keys holds credentials, not archived records. The audit
-- entries referencing "key:<id>" survive in audit_log but their id becomes
-- unresolvable — accept this only when the whole feature is being withdrawn.

BEGIN;

DROP INDEX IF EXISTS idx_accounting_api_keys_tenant;
DROP TABLE IF EXISTS accounting_api_keys;

COMMIT;
