Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Conversation

@ammodev
Copy link
Contributor

@ammodev ammodev commented Aug 12, 2025

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:

  • Changed several table names to use plural forms for consistency (cloud_playercloud_players, cloud_player_name_historycloud_player_name_histories, whitelistwhitelists). [1] [2] [3]
  • Updated AbstractPunishmentTable to replace punishedUuid and issuerUuid fields with foreign key references to CloudPlayerTable, and added a parentPunishment self-reference for hierarchical punishments.
  • Updated AbstractUnpunishableExpirablePunishmentTable to replace unpunisherUuid with a foreign key reference to CloudPlayerTable.

Migration and index changes:

  • Updated the migration script name to reflect the new changes: V8__change_tables_add_cloud_player_references.
  • Fixed a minor typo in the unique index definition in WhitelistTable.

Copilot AI review requested due to automatic review settings August 12, 2025 08:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

uniqueIndex(uuid, group)
uniqueIndex(uuid, serverName,)
uniqueIndex(uuid, serverName)
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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(
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for CloudPlayerTable. The reference to CloudPlayerTable will cause a compilation error without the proper import.

Copilot uses AI. Check for mistakes.
onDelete = ReferenceOption.CASCADE,
onUpdate = ReferenceOption.CASCADE
).nullable()
val punishedPlayer = reference(
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for CloudPlayerTable. The reference to CloudPlayerTable will cause a compilation error without the proper import.

Copilot uses AI. Check for mistakes.
@twisti-dev
Copy link
Contributor

twisti-dev commented Aug 13, 2025

Superseded by 99ac5a4

@twisti-dev twisti-dev closed this Aug 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants