545065b527
Build & Auto-Repair / build (push) Has been cancelled
- Kanban board with drag-and-drop per stage, colour-coded cards, score bars - Project Management with milestones, Gantt timeline, inline add milestone/task - Proposal/Quote builder with line items, VAT, terms, e-signature capture - Time Tracking with stopwatch, manual entry, hours-by-project chart - Custom Fields system: admin-defined fields per entity (leads/customers/ projects/opportunities) with drag-and-drop reordering in settings - Reusable CustomFieldsSection component for entity detail pages - Customers API endpoint - All builds pass with zero errors
90 lines
2.8 KiB
PL/PgSQL
90 lines
2.8 KiB
PL/PgSQL
-- ============================================================================
|
|
-- CRM Database — Full Migration Runner
|
|
-- ============================================================================
|
|
-- Usage: psql -U postgres -d crm -f run_all.sql
|
|
-- ============================================================================
|
|
|
|
BEGIN;
|
|
\set ON_ERROR_STOP on
|
|
|
|
\echo '=== Running 001_schema.sql (Tables + Constraints + Functions + Views) ==='
|
|
\i 001_schema.sql
|
|
|
|
\echo '=== Running 002_seed.sql (RBAC + Test Accounts + Reference Data) ==='
|
|
\i 002_seed.sql
|
|
|
|
\echo '=== Running 003_chat.sql (Chat Tables) ==='
|
|
\i 003_chat.sql
|
|
|
|
\echo '=== Running 004_avatar_url.sql (Avatar URL Column) ==='
|
|
\i 004_avatar_url.sql
|
|
|
|
\echo '=== Running 005_last_read_at.sql (Last Read At Column) ==='
|
|
\i 005_last_read_at.sql
|
|
|
|
\echo '=== Running 006_test_leads.sql (Test Lead Data) ==='
|
|
\i 006_test_leads.sql
|
|
|
|
\echo '=== Running 007_ai_features.sql (AI Features) ==='
|
|
\i 007_ai_features.sql
|
|
|
|
\echo '=== Running 008_notifications.sql (Notifications + Preferences) ==='
|
|
\i 008_notifications.sql
|
|
|
|
\echo '=== Running 009_settings.sql (Company Settings + User Preferences) ==='
|
|
\i 009_settings.sql
|
|
|
|
\echo '=== Running 010_chat_notifications.sql (Chat Notifications) ==='
|
|
\i 010_chat_notifications.sql
|
|
|
|
\echo '=== Running 010_facebook_accounts.sql (Facebook Accounts) ==='
|
|
\i 010_facebook_accounts.sql
|
|
|
|
\echo '=== Running 011_calendar_events.sql (Calendar Events) ==='
|
|
\i 011_calendar_events.sql
|
|
|
|
\echo '=== Running 012_invites.sql (Invites) ==='
|
|
\i 012_invites.sql
|
|
|
|
\echo '=== Running 012_sent_emails.sql (Sent Email Log) ==='
|
|
\i 012_sent_emails.sql
|
|
|
|
\echo '=== Running 013_security_upgrade.sql (Security Architecture) ==='
|
|
\i 013_security_upgrade.sql
|
|
|
|
\echo '=== Running 013_rls_calendar.sql (Calendar RLS) ==='
|
|
\i 013_rls_calendar.sql
|
|
|
|
\echo '=== Running 014_bug_reports.sql (Bug Reporting System) ==='
|
|
\i 014_bug_reports.sql
|
|
|
|
\echo '=== Running 014_notifications_context.sql (Notifications Context) ==='
|
|
\i 014_notifications_context.sql
|
|
|
|
\echo '=== Running 015_rls_calendar_participant.sql (Calendar RLS Participant Fix) ==='
|
|
\i 015_rls_calendar_participant.sql
|
|
|
|
\echo '=== Running 016_participant_notes.sql (Participant Notes Column) ==='
|
|
\i 016_participant_notes.sql
|
|
|
|
\echo '=== Running 017_calendar_developer.sql (Calendar Developer Assignment) ==='
|
|
\i 017_calendar_developer.sql
|
|
|
|
\echo '=== Running 018_website_creation_type.sql (Website Creation Event Type) ==='
|
|
\i 018_website_creation_type.sql
|
|
|
|
\echo '=== Running 019_allow_null_start_time.sql (Allow Null Start Time) ==='
|
|
\i 019_allow_null_start_time.sql
|
|
|
|
\echo '=== Running 020_projects.sql (Project Management) ==='
|
|
\i 020_projects.sql
|
|
|
|
\echo '=== Running 021_proposals_time.sql (Proposals + Time Tracking) ==='
|
|
\i 021_proposals_time.sql
|
|
|
|
\echo '=== Running 022_custom_fields.sql (Custom Fields + Workflows) ==='
|
|
\i 022_custom_fields.sql
|
|
|
|
\echo '=== Migration Complete ==='
|
|
COMMIT;
|