This repository was archived by the owner on Dec 10, 2025. It is now read-only.
refactor: migrate from CHAR-based UUIDs to native UUID types in database schema #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview of Changes
Replaced all usages of
CHAR(36)-based UUID columns in both application schema definitions and actual database migration scripts with nativeUUIDtypes. This includes creating a newNativeUuidColumnType, updating Exposed table definitions, and modifying the relevant SQL migration.Details
Refactor: Introduced NativeUuidColumnType
NativeUuidColumnTypeinexposed/columns, supporting native SQL UUID storage with robust deserialization from multiple formats (UUID, ByteArray, String, ByteBuffer).nativeUuid()for easier column registration.Refactor: Updated Table Column Definitions
charUuid()usages withnativeUuid()in the following tables:CloudPlayerTableAbstractPunishmentTableAbstractUnpunishableExpirablePunishmentTableAbstractPunishmentNoteTableRefactor: Simplified Imports in Migration Script Generator
Migration Script: V5__replace_string_uuid_with_native_uuid.sql
CHAR(36)to nativeUUIDtypes in all affected tables:cloud_playerpunish_banspunish_kickspunish_mutespunish_notes_*punish_warningsMotivation
The use of native UUID types improves database performance, storage efficiency, and compatibility with UUID-aware tools and platforms. It also aligns better with type-safe practices in Kotlin and Exposed.
Impact
Testing
V5__replace_string_uuid_with_native_uuid.sql) runs without errors on test databases.Additional Notes
Closes #81