# `PhoenixKit.Migrations.Postgres.V02`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.165/lib/phoenix_kit/migrations/postgres/v02.ex#L1)

PhoenixKit Migration V02: Remove is_active column from role assignments.

This migration removes the is_active column from role assignments table,
simplifying the role system to use direct deletion instead of soft deletion.

## Changes

- Remove is_active column from phoenix_kit_user_role_assignments table
- Remove performance indexes that used is_active column
- Clean up existing inactive role assignments (convert to actual deletions)

## Migration Strategy

1. Remove inactive assignments (where is_active = false)
2. Drop indexes that reference is_active column
3. Drop is_active column from role assignments table

## Rollback Strategy

- Adds back is_active column with default true
- Recreates performance indexes
- All existing assignments become active by default

**Note**: This migration cannot preserve inactive assignment history.
Consider backing up inactive assignments if audit trail is required.

# `description`

Returns migration description for logging and status display.

# `destructive?`

Returns whether this migration is destructive (cannot be safely rolled back).

# `down`

Rollback V02 migration by restoring is_active column.

**Warning**: This cannot restore previously deleted inactive assignments.

# `estimated_time`

Returns estimated migration time for progress tracking.

# `pre_migration_report`

Pre-migration checks and warnings.

Counts inactive assignments that will be permanently deleted.

# `up`

Run the V02 migration to remove is_active column.

# `validate_prerequisites`

Validates prerequisites before running migration.

Ensures V01 migration has been applied.

# `version`

Returns the migration version.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
