refactor(organizations): remove searchable feature migration files
- Deleted the migration files for adding and rolling back the 'searchable' column in the organizations table. - Introduced a new migration for creating organization-related tables, consolidating previous migrations into a single structure for better organization management.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
-- Migration: 000011_organizations (down, merged 000011–000017)
|
||||
-- Migration: 000011_organizations (down, merged 000011–000017, 000012)
|
||||
DO $$ BEGIN RAISE NOTICE '[Migration 000011] Rolling back organization tables...'; END $$;
|
||||
|
||||
DROP TABLE IF EXISTS organization_join_requests;
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
-- Migration: 000011_organizations (merged 000011–000017)
|
||||
-- Description: Organization tables, approval, invite expiry, join requests, avatar
|
||||
-- Migration: 000011_organizations (merged 000011–000017, 000012)
|
||||
-- Description: Organization tables, approval, invite expiry, join requests, avatar, searchable
|
||||
DO $$ BEGIN RAISE NOTICE '[Migration 000011] Starting organization tables setup...'; END $$;
|
||||
|
||||
-- Create organizations table
|
||||
@@ -13,6 +13,7 @@ CREATE TABLE IF NOT EXISTS organizations (
|
||||
invite_code_expires_at TIMESTAMP WITH TIME ZONE,
|
||||
invite_code_validity_days SMALLINT NOT NULL DEFAULT 7,
|
||||
avatar VARCHAR(512) DEFAULT '',
|
||||
searchable BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMP WITH TIME ZONE
|
||||
@@ -28,6 +29,7 @@ COMMENT ON COLUMN organizations.invite_code IS 'Unique invitation code for joini
|
||||
COMMENT ON COLUMN organizations.require_approval IS 'Whether joining this organization requires admin approval';
|
||||
COMMENT ON COLUMN organizations.invite_code_expires_at IS 'When the current invite code expires; NULL means no expiry (legacy)';
|
||||
COMMENT ON COLUMN organizations.invite_code_validity_days IS 'Invite link validity in days: 0=never expire, 1/7/30 days';
|
||||
COMMENT ON COLUMN organizations.searchable IS 'When true, space appears in search and can be joined by org ID';
|
||||
|
||||
-- Create organization_members table
|
||||
CREATE TABLE IF NOT EXISTS organization_members (
|
||||
@@ -1,2 +0,0 @@
|
||||
-- Rollback: 000012_organizations_searchable
|
||||
ALTER TABLE organizations DROP COLUMN IF EXISTS searchable;
|
||||
@@ -1,8 +0,0 @@
|
||||
-- Migration: 000012_organizations_searchable
|
||||
-- Description: Add searchable flag to organizations (open for discovery)
|
||||
DO $$ BEGIN RAISE NOTICE '[Migration 000012] Adding searchable to organizations...'; END $$;
|
||||
|
||||
ALTER TABLE organizations ADD COLUMN IF NOT EXISTS searchable BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
COMMENT ON COLUMN organizations.searchable IS 'When true, space appears in search and can be joined by org ID';
|
||||
|
||||
DO $$ BEGIN RAISE NOTICE '[Migration 000012] Organizations searchable column added.'; END $$;
|
||||
Reference in New Issue
Block a user