Rebuild nostr_permissions to remove the legacy UNIQUE(origin, action) constraint and enforce UNIQUE(profile_id, origin, action).
Current state:
- profile_id column exists
- application helpers query by active profile_id
- unique index on (profile_id, origin, action) exists
- legacy UNIQUE(origin, action) still exists from the original table schema
Goal:
- safely migrate existing permissions into a new table
- preserve existing permission rows
- remove legacy global uniqueness constraint
- enforce strict per-profile NIP-07 permission isolation
This should be done carefully because it touches security-sensitive NIP-07 permission persistence.
Rebuild nostr_permissions to remove the legacy UNIQUE(origin, action) constraint and enforce UNIQUE(profile_id, origin, action).
Current state:
Goal:
This should be done carefully because it touches security-sensitive NIP-07 permission persistence.