chore: clean up migration files and update CLAUDE.md documentation
- Consolidate migration numbering (move full_bas_2026 to slot 044) - Remove dead/superseded migrations (document_matching, reversal columns) - Update CLAUDE.md with placeholder migration notes and corrected descriptions - Fix migration SQL for invoice_inbox, extension_data, supplier_invoices Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9cd950de88
commit
0c422fcd25
@@ -1,19 +1,18 @@
|
||||
-- Migration 034: Fix extension_data updated_at trigger
|
||||
-- The original trigger references update_updated_at() which does not exist.
|
||||
-- The correct function is public.update_updated_at_column().
|
||||
-- Wrapped in DO block in case extension_data table does not yet exist.
|
||||
-- Originally fixed a wrong function reference (update_updated_at vs update_updated_at_column).
|
||||
-- The issue is now fixed directly in migration 020, making this a no-op for fresh deployments.
|
||||
-- Kept for migration numbering sequence. Safe to re-run: just drops a trigger that may not exist.
|
||||
|
||||
do $$
|
||||
begin
|
||||
if exists (
|
||||
select 1 from information_schema.tables
|
||||
where table_schema = 'public' and table_name = 'extension_data'
|
||||
) then
|
||||
drop trigger if exists extension_data_updated_at on public.extension_data;
|
||||
|
||||
create trigger extension_data_updated_at
|
||||
before update on public.extension_data
|
||||
for each row execute function public.update_updated_at_column();
|
||||
end if;
|
||||
end;
|
||||
DO $$
|
||||
BEGIN
|
||||
-- Drop the incorrectly-named trigger if it exists from an older migration version
|
||||
IF EXISTS (
|
||||
SELECT 1 FROM information_schema.triggers
|
||||
WHERE trigger_schema = 'public'
|
||||
AND event_object_table = 'extension_data'
|
||||
AND trigger_name = 'extension_data_updated_at'
|
||||
) THEN
|
||||
DROP TRIGGER extension_data_updated_at ON public.extension_data;
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
|
||||
Reference in New Issue
Block a user