-- t-paliad-349: revert docforge template authoring tables.
--
-- Drop the FK first so the templates ↔ template_versions cycle unwinds,
-- then the tables (template_slots + template_versions cascade from their
-- parents, but drop explicitly for clarity and order-independence).

ALTER TABLE IF EXISTS paliad.templates
    DROP CONSTRAINT IF EXISTS templates_current_version_fk;

DROP TABLE IF EXISTS paliad.template_slots;
DROP TABLE IF EXISTS paliad.template_versions;
DROP TABLE IF EXISTS paliad.templates;
