Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fun main() {
MutePunishmentNoteTable,
WarnPunishmentNoteTable,
WhitelistTable,
scriptName = "V7__add_whitelist_table",
scriptName = "V8__change_tables_add_cloud_player_references",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dev.slne.surf.cloud.api.server.exposed.table.AuditableLongIdTable
import org.jetbrains.exposed.sql.ReferenceOption
import java.net.Inet4Address

object CloudPlayerTable : AuditableLongIdTable("cloud_player") {
object CloudPlayerTable : AuditableLongIdTable("cloud_players") {
val uuid = nativeUuid("uuid").uniqueIndex()
val lastServer = char("last_server", 255).nullable()
val lastSeen = zonedDateTime("last_seen").nullable()
Expand All @@ -19,7 +19,7 @@ object CloudPlayerTable : AuditableLongIdTable("cloud_player") {
.nullable()
}

object CloudPlayerNameHistoryTable : AuditableLongIdTable("cloud_player_name_history") {
object CloudPlayerNameHistoryTable : AuditableLongIdTable("cloud_player_name_histories") {
val name = char("name", 16)
val player = reference(
"cloud_player_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ import dev.slne.surf.cloud.api.server.exposed.table.AuditableLongIdTable

abstract class AbstractPunishmentTable(name: String) : AuditableLongIdTable(name) {
val punishmentId = char("punishment_id", 8).uniqueIndex()
val punishedUuid = nativeUuid("punished_uuid")
val issuerUuid = nativeUuid("issuer_uuid").nullable()
val parentPunishment = reference(
"parent_punishment_id",
this,
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.
"cloud_player_id",
CloudPlayerTable,
onDelete = ReferenceOption.CASCADE,
onUpdate = ReferenceOption.CASCADE
)
val issuerPlayer = reference(
"issuer_id",
CloudPlayerTable,
onDelete = ReferenceOption.SET_NULL,
onUpdate = ReferenceOption.SET_NULL
).nullable()
val reason = largeText("reason").nullable()

init {
index("idx_punished_uuid", false, punishedUuid)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ abstract class AbstractUnpunishableExpirablePunishmentTable(name: String) :
AbstractPunishmentTable(name) {
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.
"unpunisher_id",
CloudPlayerTable,
onDelete = ReferenceOption.CASCADE,
onUpdate = ReferenceOption.CASCADE
).nullable().default(null)
val expirationDate = zonedDateTime("expiration_date").nullable().default(null)
val permanent = bool("permanent").default(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import org.jetbrains.exposed.sql.ReferenceOption
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.or

object WhitelistTable : AuditableLongIdTable("whitelist") {
val uuid = nativeUuid("uuid").index()
object WhitelistTable : AuditableLongIdTable("whitelists") {
val blocked = bool("blocked").default(false)
val group = varchar("group", 255).nullable()
val serverName = varchar("server_name", 255).nullable()
Expand All @@ -25,6 +24,6 @@ object WhitelistTable : AuditableLongIdTable("whitelist") {
}

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.
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.
}
}