Conversation
…me tables for consistency
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the database schema to improve consistency and referential integrity by standardizing table naming conventions and replacing UUID fields with proper foreign key relationships.
- Updated table names to use plural forms for consistency across the schema
- Replaced UUID fields with foreign key references to CloudPlayerTable for better data integrity
- Added hierarchical punishment support through self-referencing relationships
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| WhitelistTable.kt | Updated table name to plural form and fixed trailing comma syntax |
| AbstractUnpunishableExpirablePunishmentTable.kt | Replaced unpunisherUuid with foreign key reference to CloudPlayerTable |
| AbstractPunishmentTable.kt | Replaced UUID fields with foreign key references and added parent punishment relationship |
| CloudPlayerTables.kt | Updated table names to plural forms for consistency |
| GenerateExposedMigrationScript.kt | Updated migration script name to reflect schema changes |
|
|
||
| uniqueIndex(uuid, group) | ||
| uniqueIndex(uuid, serverName,) | ||
| uniqueIndex(uuid, serverName) |
There was a problem hiding this comment.
The uuid field is referenced in the uniqueIndex but it was removed from the table definition. This will cause a compilation error as the uuid field no longer exists.
|
|
||
| uniqueIndex(uuid, group) | ||
| uniqueIndex(uuid, serverName,) | ||
| uniqueIndex(uuid, serverName) |
There was a problem hiding this comment.
The uuid field is referenced in the uniqueIndex but it was removed from the table definition. This will cause a compilation error as the uuid field no longer exists.
| val unpunished = bool("unpunished").default(false) | ||
| val unpunishedDate = zonedDateTime("unpunished_date").nullable().default(null) | ||
| val unpunisherUuid = nativeUuid("unpunisher_uuid").nullable().default(null) | ||
| val unpunisherPlayer = reference( |
There was a problem hiding this comment.
Missing import statement for CloudPlayerTable. The reference to CloudPlayerTable will cause a compilation error without the proper import.
| onDelete = ReferenceOption.CASCADE, | ||
| onUpdate = ReferenceOption.CASCADE | ||
| ).nullable() | ||
| val punishedPlayer = reference( |
There was a problem hiding this comment.
Missing import statement for CloudPlayerTable. The reference to CloudPlayerTable will cause a compilation error without the proper import.
|
Superseded by 99ac5a4 |
This pull request updates the database schema and related code to improve referential integrity and consistency in table naming. The main changes include updating table names to be plural, replacing UUID fields with foreign key references to the
CloudPlayerTable, and updating migration script naming.Database schema improvements:
cloud_player→cloud_players,cloud_player_name_history→cloud_player_name_histories,whitelist→whitelists). [1] [2] [3]AbstractPunishmentTableto replacepunishedUuidandissuerUuidfields with foreign key references toCloudPlayerTable, and added aparentPunishmentself-reference for hierarchical punishments.AbstractUnpunishableExpirablePunishmentTableto replaceunpunisherUuidwith a foreign key reference toCloudPlayerTable.Migration and index changes:
V8__change_tables_add_cloud_player_references.WhitelistTable.