1- RENAME TABLE ` space_invites` TO ` organization_invites` ;
2- RENAME TABLE ` space_members` TO ` organization_members` ;
3- RENAME TABLE ` spaces` TO ` organizations` ;
4- ALTER TABLE ` shared_videos` RENAME COLUMN ` spaceId` TO ` organizationId` ;
5- ALTER TABLE ` organization_invites` RENAME COLUMN ` spaceId` TO ` organizationId` ;
6- ALTER TABLE ` organization_members` RENAME COLUMN ` spaceId` TO ` organizationId` ;
7- ALTER TABLE ` users` RENAME COLUMN ` activeSpaceId` TO ` activeOrganizationId` ;
8- ALTER TABLE ` organization_invites` DROP INDEX ` space_invites_id_unique` ;
9- ALTER TABLE ` organization_members` DROP INDEX ` space_members_id_unique` ;
10- ALTER TABLE ` organizations` DROP INDEX ` spaces_id_unique` ;
11- DROP INDEX ` space_id_idx` ON ` shared_videos` ;
12- DROP INDEX ` video_id_space_id_idx` ON ` shared_videos` ;
13- DROP INDEX ` space_id_idx` ON ` organization_invites` ;
14- DROP INDEX ` space_id_idx` ON ` organization_members` ;
15- DROP INDEX ` user_id_space_id_idx` ON ` organization_members` ;
16- ALTER TABLE ` organization_invites` DROP PRIMARY KEY ;
17- ALTER TABLE ` organization_members` DROP PRIMARY KEY ;
18- ALTER TABLE ` organizations` DROP PRIMARY KEY ;
19- ALTER TABLE ` organization_invites` ADD PRIMARY KEY (` id` );
20- ALTER TABLE ` organization_members` ADD PRIMARY KEY (` id` );
21- ALTER TABLE ` organizations` ADD PRIMARY KEY (` id` );
22- ALTER TABLE ` organization_invites` ADD CONSTRAINT ` organization_invites_id_unique` UNIQUE(` id` );
23- ALTER TABLE ` organization_members` ADD CONSTRAINT ` organization_members_id_unique` UNIQUE(` id` );
24- ALTER TABLE ` organizations` ADD CONSTRAINT ` organizations_id_unique` UNIQUE(` id` );
25- CREATE INDEX `organization_id_idx ` ON ` shared_videos` (` organizationId` );
26- CREATE INDEX `video_id_organization_id_idx ` ON ` shared_videos` (` videoId` ,` organizationId` );
27- CREATE INDEX `organization_id_idx ` ON ` organization_invites` (` organizationId` );
28- CREATE INDEX `organization_id_idx ` ON ` organization_members` (` organizationId` );
29- CREATE INDEX `user_id_organization_id_idx ` ON ` organization_members` (` userId` ,` organizationId` );
1+ RENAME TABLE ` space_invites` TO ` organization_invites` ;-- > statement-breakpoint
2+ RENAME TABLE ` space_members` TO ` organization_members` ;-- > statement-breakpoint
3+ RENAME TABLE ` spaces` TO ` organizations` ;-- > statement-breakpoint
4+ ALTER TABLE ` shared_videos` RENAME COLUMN ` spaceId` TO ` organizationId` ;-- > statement-breakpoint
5+ ALTER TABLE ` organization_invites` RENAME COLUMN ` spaceId` TO ` organizationId` ;-- > statement-breakpoint
6+ ALTER TABLE ` organization_members` RENAME COLUMN ` spaceId` TO ` organizationId` ;-- > statement-breakpoint
7+ ALTER TABLE ` users` RENAME COLUMN ` activeSpaceId` TO ` activeOrganizationId` ;-- > statement-breakpoint
8+ ALTER TABLE ` organization_invites` DROP INDEX ` space_invites_id_unique` ;-- > statement-breakpoint
9+ ALTER TABLE ` organization_members` DROP INDEX ` space_members_id_unique` ;-- > statement-breakpoint
10+ ALTER TABLE ` organizations` DROP INDEX ` spaces_id_unique` ;-- > statement-breakpoint
11+ DROP INDEX ` space_id_idx` ON ` shared_videos` ;-- > statement-breakpoint
12+ DROP INDEX ` video_id_space_id_idx` ON ` shared_videos` ;-- > statement-breakpoint
13+ DROP INDEX ` space_id_idx` ON ` organization_invites` ;-- > statement-breakpoint
14+ DROP INDEX ` space_id_idx` ON ` organization_members` ;-- > statement-breakpoint
15+ DROP INDEX ` user_id_space_id_idx` ON ` organization_members` ;-- > statement-breakpoint
16+ ALTER TABLE ` organization_invites` DROP PRIMARY KEY ;-- > statement-breakpoint
17+ ALTER TABLE ` organization_members` DROP PRIMARY KEY ;-- > statement-breakpoint
18+ ALTER TABLE ` organizations` DROP PRIMARY KEY ;-- > statement-breakpoint
19+ ALTER TABLE ` organization_invites` ADD PRIMARY KEY (` id` );-- > statement-breakpoint
20+ ALTER TABLE ` organization_members` ADD PRIMARY KEY (` id` );-- > statement-breakpoint
21+ ALTER TABLE ` organizations` ADD PRIMARY KEY (` id` );-- > statement-breakpoint
22+ ALTER TABLE ` organization_invites` ADD CONSTRAINT ` organization_invites_id_unique` UNIQUE(` id` );-- > statement-breakpoint
23+ ALTER TABLE ` organization_members` ADD CONSTRAINT ` organization_members_id_unique` UNIQUE(` id` );-- > statement-breakpoint
24+ ALTER TABLE ` organizations` ADD CONSTRAINT ` organizations_id_unique` UNIQUE(` id` );-- > statement-breakpoint
25+ CREATE INDEX `organization_id_idx ` ON ` shared_videos` (` organizationId` );-- > statement-breakpoint
26+ CREATE INDEX `video_id_organization_id_idx ` ON ` shared_videos` (` videoId` ,` organizationId` );-- > statement-breakpoint
27+ CREATE INDEX `organization_id_idx ` ON ` organization_invites` (` organizationId` );-- > statement-breakpoint
28+ CREATE INDEX `organization_id_idx ` ON ` organization_members` (` organizationId` );-- > statement-breakpoint
29+ CREATE INDEX `user_id_organization_id_idx ` ON ` organization_members` (` userId` ,` organizationId` );
0 commit comments