first commit
This commit is contained in:
59
migrations/000001_initial_schema.down.sql
Normal file
59
migrations/000001_initial_schema.down.sql
Normal file
@@ -0,0 +1,59 @@
|
||||
-- ============================================================================
|
||||
-- Krow — initial schema, reversed.
|
||||
--
|
||||
-- Drops exactly what 000001_initial_schema.up.sql created, in reverse
|
||||
-- dependency order, and nothing else. Every DROP is qualified to `public` and
|
||||
-- named explicitly — there is no CASCADE on a schema, no DROP SCHEMA, and no
|
||||
-- DROP DATABASE anywhere in this file.
|
||||
-- ============================================================================
|
||||
|
||||
SET search_path = public;
|
||||
|
||||
-- Tables, children before parents. Indexes and table-level constraints are
|
||||
-- dropped implicitly with their table.
|
||||
DROP TABLE IF EXISTS public.user_activity;
|
||||
DROP TABLE IF EXISTS public.evidence;
|
||||
DROP TABLE IF EXISTS public.shift_records;
|
||||
DROP TABLE IF EXISTS public.assignments;
|
||||
DROP TABLE IF EXISTS public.staff;
|
||||
DROP TABLE IF EXISTS public.ai_interviews;
|
||||
DROP TABLE IF EXISTS public.job_applications;
|
||||
DROP TABLE IF EXISTS public.worker_profiles;
|
||||
DROP TABLE IF EXISTS public.job_postings;
|
||||
DROP TABLE IF EXISTS public.learning_paths;
|
||||
DROP TABLE IF EXISTS public.courses;
|
||||
DROP TABLE IF EXISTS public.badges;
|
||||
DROP TABLE IF EXISTS public.certifications;
|
||||
DROP TABLE IF EXISTS public.role_categories;
|
||||
DROP TABLE IF EXISTS public.user_preferences;
|
||||
DROP TABLE IF EXISTS public.users;
|
||||
DROP TABLE IF EXISTS public.organizations;
|
||||
|
||||
-- Enums, after every table that referenced them is gone.
|
||||
DROP TYPE IF EXISTS public.badge_verification;
|
||||
DROP TYPE IF EXISTS public.badge_level;
|
||||
DROP TYPE IF EXISTS public.evidence_verdict;
|
||||
DROP TYPE IF EXISTS public.challenge_type;
|
||||
DROP TYPE IF EXISTS public.skill_level;
|
||||
DROP TYPE IF EXISTS public.course_status;
|
||||
DROP TYPE IF EXISTS public.shift_status;
|
||||
DROP TYPE IF EXISTS public.assignment_status;
|
||||
DROP TYPE IF EXISTS public.profile_tier;
|
||||
DROP TYPE IF EXISTS public.staff_status;
|
||||
DROP TYPE IF EXISTS public.interview_verdict;
|
||||
DROP TYPE IF EXISTS public.application_status;
|
||||
DROP TYPE IF EXISTS public.english_level;
|
||||
DROP TYPE IF EXISTS public.posting_priority;
|
||||
DROP TYPE IF EXISTS public.posting_status;
|
||||
|
||||
-- The citext extension is deliberately NOT dropped.
|
||||
--
|
||||
-- CREATE EXTENSION IF NOT EXISTS is a no-op when the extension already exists,
|
||||
-- so the up migration cannot tell whether it created citext or inherited it.
|
||||
-- Dropping it on the way down would therefore risk removing an object this
|
||||
-- migration never owned, and would break any other schema that has since
|
||||
-- adopted the type. Leaving it is harmless: it holds no data, and re-applying
|
||||
-- the up migration is unaffected.
|
||||
--
|
||||
-- To remove it by hand on a database where nothing else uses it:
|
||||
-- DROP EXTENSION IF EXISTS citext;
|
||||
Reference in New Issue
Block a user