Add parent_id column for alias identity support

Migration and initial schemas for linking alias identities to parent
accounts via a nullable parent_id foreign key.
This commit is contained in:
Laurent Dinclaux
2026-02-10 22:28:20 +11:00
parent fd9836c7ae
commit 08797ab5a8
7 changed files with 35 additions and 1 deletions

View File

@@ -11,6 +11,9 @@ CREATE TABLE IF NOT EXISTS `ident_switch`
int UNSIGNED
NOT NULL
UNIQUE,
`parent_id`
int UNSIGNED
DEFAULT NULL,
`username`
varchar(64),
`password`
@@ -80,5 +83,6 @@ CREATE TABLE IF NOT EXISTS `ident_switch`
CONSTRAINT `fk_identity_id` FOREIGN KEY (`iid`) REFERENCES `identities`(`identity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
PRIMARY KEY(`id`),
INDEX `IX_ident_switch_user_id`(`user_id`),
INDEX `IX_ident_switch_iid`(`iid`)
INDEX `IX_ident_switch_iid`(`iid`),
INDEX `IX_ident_switch_parent_id`(`parent_id`)
);