Open akuplace opened 7 months ago
I believe that removing IDs on what should be weak entities should prove to help in an efficiency increase in the database by instead replacing them with composite primary keys.
An example would be:
model Subscription { id String @id @default(uuid()) // this is removed roleId String? discordChannelId String? memberRoleId String? memberDiscordChannelId String? relayChannelId String? cameoChannelId String? communityPostRoleId String? communityPostChannelId String? channelId String channel HolodexChannel @relation(fields: [channelId], references: [id], onDelete: Cascade) guildId String guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade) @@unique([channelId, guildId]) //replaced with @@id([channelId, guildId]) }
I'm not very sure about this change so if someone could have a glance over it or test it out it would be extremely appreciated 🙇
I believe that removing IDs on what should be weak entities should prove to help in an efficiency increase in the database by instead replacing them with composite primary keys.
An example would be: