Skip to content

feat(RM-40): MessageID & ChannelID as nullable#2

Open
DanPlayz0 wants to merge 1 commit intoTicketsBot-cloud:masterfrom
DanPlayz0:feat/rm-40
Open

feat(RM-40): MessageID & ChannelID as nullable#2
DanPlayz0 wants to merge 1 commit intoTicketsBot-cloud:masterfrom
DanPlayz0:feat/rm-40

Conversation

@DanPlayz0
Copy link
Copy Markdown
Contributor

@DanPlayz0 DanPlayz0 commented May 18, 2025

This pull request introduces changes to the panels.go file, primarily to allow message_id and channel_id fields to be nullable, improving flexibility in handling panel data. Key updates include modifying the schema, struct definitions, and related methods to support nullable values.

Schema and struct updates:

  • Changed the message_id and channel_id fields in the Panel struct to be pointers (*uint64) to allow null values. (panels.goL14-R15)
  • Updated the database schema for the panels table to make message_id and channel_id nullable by setting their default to NULL. (panels.goL59-R60)

Method updates:

  • Modified UpdateMessageId to accept a pointer (*uint64) for message_id to handle nullable values. (panels.goL601-R601)
  • Added a new method UpdateChannelId to update the channel_id field, also supporting nullable values. (panels.goR612-R622)

Migration:

  • This pull request does require an update to the database to allow nullable fields (channel_id & message_id)
    ALTER TABLE panels ALTER COLUMN "channel_id" DROP NOT NULL;
    ALTER TABLE panels ALTER COLUMN "message_id" DROP NOT NULL;

Notes

This PR was originally created in May, and was later updated; original changes can be found by comparing commits 17762cd7d39ae3c02a4746978cff5021a749f80b & e113c4330d33cc2cc885a240c0dd4427e052eb29

@DanPlayz0 DanPlayz0 requested a review from a team as a code owner November 15, 2025 00:52
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.

1 participant