ultisuite-backend/migrations/000048_migration_roster.up.sql
R3D347HR4Y 1ffd0817d8
Some checks are pending
CI / Go tests (push) Waiting to run
CI / Integration tests (push) Waiting to run
CI / DB migrations (push) Waiting to run
feat(migration): enhance migration API with roster and audit export features
- Added endpoints for listing and importing migration rosters.
- Introduced audit export functionality for migration jobs in CSV and NDJSON formats.
- Implemented tenant mismatch validation for Microsoft migration claims.
- Enhanced error handling for email claiming and migration processes.
- Added integration tests for roster import and claim workflows.
2026-06-13 13:11:30 +02:00

18 lines
854 B
SQL

CREATE TABLE migration_roster (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
project_id UUID NOT NULL REFERENCES migration_projects(id) ON DELETE CASCADE,
email TEXT NOT NULL,
display_name TEXT NOT NULL DEFAULT '',
alternate_emails TEXT[] NOT NULL DEFAULT '{}',
status TEXT NOT NULL DEFAULT 'pending',
invite_id UUID REFERENCES migration_invites(id) ON DELETE SET NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (project_id, email),
CONSTRAINT migration_roster_status_check CHECK (status IN ('pending', 'invited', 'claimed'))
);
CREATE INDEX idx_migration_roster_project ON migration_roster(project_id);
CREATE INDEX idx_migration_roster_status ON migration_roster(status);
CREATE INDEX idx_migration_roster_invite ON migration_roster(invite_id);