Skip to content

feat: implement new whitelist and social connections tables with upda…#1

Open
TheBjoRedCraft wants to merge 2 commits intoversion/1.21.11from
feat/new-table
Open

feat: implement new whitelist and social connections tables with upda…#1
TheBjoRedCraft wants to merge 2 commits intoversion/1.21.11from
feat/new-table

Conversation

@TheBjoRedCraft
Copy link
Copy Markdown
Member

…ted database queries

@TheBjoRedCraft TheBjoRedCraft self-assigned this Apr 18, 2026
Copilot AI review requested due to automatic review settings April 18, 2026 12:49
Copy link
Copy Markdown

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

Implements a new database schema split between “social connections” and “freebuild whitelist” data, and updates the whitelist lookup queries to use the new tables.

Changes:

  • Introduces new SocialConnectionsTable and FreebuildWhitelistTable tables and creates them at startup.
  • Updates WhitelistService queries to read whitelist state via an INNER JOIN over the new tables.
  • Adjusts WhitelistEntry.discordUserId to be nullable and bumps the project snapshot version.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/kotlin/dev/slne/surf/freebuild/whitelist/entry/WhitelistEntry.kt Makes discordUserId nullable to reflect new schema.
src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/table/SocialsTable.kt Renames mapped table to social_connections_new (now overlaps with new table mapping).
src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/table/SocialConnectionsTable.kt Adds new auditable “social connections” table mapping.
src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/table/FreebuildWhitelistTable.kt Adds new auditable “freebuild whitelist” table mapping with FK to social connections.
src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/service/WhitelistService.kt Updates whitelist queries to join new tables and map result rows.
src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/DatabaseLoader.kt Creates the new tables via SchemaUtils.create.
gradle.properties Bumps snapshot version.
Comments suppressed due to low confidence (1)

src/main/kotlin/dev/slne/surf/freebuild/whitelist/database/table/SocialsTable.kt:13

  • SocialsTable now points to the same physical table name (social_connections_new) as SocialConnectionsTable, but defines a different set of columns (e.g., blocked, created_at, updated_at). Keeping two Exposed table objects for the same table with divergent schemas is error-prone and can lead to incorrect queries or schema creation later. Consider removing SocialsTable entirely (it appears unused) or renaming/repointing it so only one table mapping exists per DB table name.
object SocialsTable : LongIdTable("social_connections_new") {
    val discordUserId = long("discord_user_id").uniqueIndex()
    val minecraftUuid = nativeUuid("minecraft_uuid").uniqueIndex()
    val twitchId = long("twitch_id").uniqueIndex().nullable()
    val blocked = bool("blocked").default(false)
    val createdAt = offsetDateTime("created_at")
    val updatedAt = offsetDateTime("updated_at")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants