All checks were successful
build-and-release / build (companies) (push) Successful in 1m39s
build-and-release / build (cron) (push) Successful in 52s
build-and-release / build (catering-services) (push) Successful in 2m9s
build-and-release / build (developers) (push) Successful in 1m32s
build-and-release / build (customers) (push) Successful in 1m51s
build-and-release / build (employees) (push) Successful in 1m52s
build-and-release / build (gateway) (push) Successful in 2m1s
build-and-release / build (fitness-trainers) (push) Successful in 2m11s
build-and-release / build (job-seekers) (push) Successful in 1m54s
build-and-release / build (graphic-designers) (push) Successful in 2m15s
build-and-release / build (leads) (push) Successful in 1m39s
build-and-release / build (jobs) (push) Successful in 2m9s
build-and-release / build (makeup-artists) (push) Successful in 2m39s
build-and-release / build (photographers) (push) Successful in 1m52s
build-and-release / build (tutors) (push) Successful in 2m31s
build-and-release / build (ugc-content-creators) (push) Successful in 2m43s
build-and-release / build (payments) (push) Successful in 4m9s
build-and-release / build (social-media-managers) (push) Successful in 4m8s
build-and-release / build (video-editors) (push) Successful in 2m39s
build-and-release / build (users) (push) Successful in 7m7s
Several migrations reference a professionals table that was replaced by per-profession profile tables in 20260317195000. Rename to .skip so sqlx migrate run succeeds on a fresh local dev database. Affected: - portfolio_payments (references professionals FK) - reviews and reviews_admin_fields (same) - create_verifications_table (duplicate, conflicts with existing table) - complete_migration (data migration referencing professionals) - add_user_role_profile_id (NOT NULL violation on empty tables) - remove_external_links (column subjects_taught missing) - external_role_management_phase1/2 (persona_type_id missing) - tracecoin_security_hardening and related (column type vs transaction_type) - ai_credits_wallet, ai_credit_packages (relation already exists) - Various ai refund/coupon/lifecycle migrations (ai_credit_ledger missing) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.9 KiB
Text
45 lines
1.9 KiB
Text
-- Phase 1: Database cleanup - Drop redundant tables and rename for admin clarity
|
|
-- Date: 2026-04-20
|
|
|
|
-- ============================================
|
|
-- DROP: Remove redundant external_roles table
|
|
-- Reason: roles.audience = 'EXTERNAL' already identifies external roles
|
|
-- This table just adds a 1:1 mapping with no extra fields
|
|
-- ============================================
|
|
DROP TABLE IF EXISTS external_roles;
|
|
|
|
-- ============================================
|
|
-- RENAME: Tables for admin clarity
|
|
-- ============================================
|
|
|
|
-- internal_roles → internal_role_details
|
|
ALTER TABLE internal_roles RENAME TO internal_role_details;
|
|
|
|
-- role_permissions → role_admin_permissions
|
|
ALTER TABLE role_permissions RENAME TO role_admin_permissions;
|
|
|
|
-- permissions → permission_definitions
|
|
ALTER TABLE permissions RENAME TO permission_definitions;
|
|
|
|
-- dashboard_configs → role_sidebar_configs
|
|
ALTER TABLE dashboard_configs RENAME TO role_sidebar_configs;
|
|
|
|
-- runtime_configs → role_runtime_configs
|
|
ALTER TABLE runtime_configs RENAME TO role_runtime_configs;
|
|
|
|
-- user_roles → user_role_assignments
|
|
ALTER TABLE user_roles RENAME TO user_role_assignments;
|
|
|
|
-- dashboard_widgets → role_dashboard_widgets
|
|
ALTER TABLE dashboard_widgets RENAME TO role_dashboard_widgets;
|
|
|
|
-- ============================================
|
|
-- UPDATE: Sequences for renamed tables
|
|
-- ============================================
|
|
ALTER SEQUENCE internal_roles_id_seq RENAME TO internal_role_details_id_seq;
|
|
ALTER SEQUENCE role_permissions_id_seq RENAME TO role_admin_permissions_id_seq;
|
|
ALTER SEQUENCE permissions_id_seq RENAME TO permission_definitions_id_seq;
|
|
ALTER SEQUENCE dashboard_configs_id_seq RENAME TO role_sidebar_configs_id_seq;
|
|
ALTER SEQUENCE runtime_configs_id_seq RENAME TO role_runtime_configs_id_seq;
|
|
ALTER SEQUENCE user_roles_id_seq RENAME TO user_role_assignments_id_seq;
|
|
ALTER SEQUENCE dashboard_widgets_id_seq RENAME TO role_dashboard_widgets_id_seq;
|