generalbots/botserver/migrations/6.2.3-crm-deals/down.sql
Rodrigo Rodriguez (Pragmatismo) 037db5c381 feat: Major workspace reorganization and documentation update
- Add comprehensive documentation in botbook/ with 12 chapters
- Add botapp/ Tauri desktop application
- Add botdevice/ IoT device support
- Add botlib/ shared library crate
- Add botmodels/ Python ML models service
- Add botplugin/ browser extension
- Add botserver/ reorganized server code
- Add bottemplates/ bot templates
- Add bottest/ integration tests
- Add botui/ web UI server
- Add CI/CD workflows in .forgejo/workflows/
- Add AGENTS.md and PROD.md documentation
- Add dependency management scripts (DEPENDENCIES.sh/ps1)
- Remove legacy src/ structure and migrations
- Clean up temporary and backup files
2026-04-19 08:14:25 -03:00

23 lines
777 B
SQL

-- Rollback: 6.2.3-crm-deals
-- ============================================
-- 1. Drop indexes
DROP INDEX IF EXISTS idx_crm_deals_org_bot;
DROP INDEX IF EXISTS idx_crm_deals_contact;
DROP INDEX IF EXISTS idx_crm_deals_account;
DROP INDEX IF EXISTS idx_crm_deals_stage;
DROP INDEX IF EXISTS idx_crm_deals_owner;
DROP INDEX IF EXISTS idx_crm_deals_source;
-- 2. Remove deal_id from crm_activities
ALTER TABLE crm_activities DROP COLUMN IF EXISTS deal_id;
-- 3. Drop crm_deals table
DROP TABLE IF EXISTS crm_deals CASCADE;
-- 4. Drop crm_deal_segments table
DROP TABLE IF EXISTS crm_deal_segments;
-- 5. Recreate old tables (for rollback)
-- Note: These need to be recreated from backup or previous schema
-- This is a placeholder - in production, you'd restore from backup