Skip to content

RM-348: Add No colour option for embeds - #49

Open
biast12 wants to merge 1 commit into
masterfrom
RM-348
Open

biast12 wants to merge 1 commit into
masterfrom
RM-348

Conversation

@biast12

@biast12 biast12 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RM-348

Description

Makes embed colours nullable: NULL means no colour and 0 means black.

  • embeds.colour, panels.colour, custom_colours.colour_code, panel_support_hours_settings.out_of_hours_colour and gallery_listings.colour are nullable, and their Go fields are pointers.
  • CustomEmbed.Colour drops omitempty, so JSONB embeds (tags, KB, multi-panels, gallery) store "colour": null.
  • CustomColours uses *int. GetAll now closes its rows and checks rows.Err(), and BatchSet checks every batch result.
  • GetByIdWithWelcomeMessage / GetByGuildWithWelcomeMessage no longer dereference the colour, which panicked on NULL.
ALTER TABLE embeds ALTER COLUMN colour DROP NOT NULL;
ALTER TABLE panels ALTER COLUMN colour DROP NOT NULL;
ALTER TABLE custom_colours ALTER COLUMN colour_code DROP NOT NULL;
ALTER TABLE panel_support_hours_settings ALTER COLUMN out_of_hours_colour DROP NOT NULL, ALTER COLUMN out_of_hours_colour DROP DEFAULT;
ALTER TABLE gallery_listings ALTER COLUMN colour DROP NOT NULL, ALTER COLUMN colour DROP DEFAULT;

Existing 0 values used to render as no colour, so they must be backfilled to NULL after deploy or they will render black. Every service that reads panels must run this version before any NULL is written.

For:
TicketsBot-cloud/worker#162
TicketsBot-cloud/dashboard#162
TicketsBot-cloud/premiumcheckdaemon#5
TicketsBot-cloud/category-update-producer#4

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement

Checklist

  • My code follows the style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Make embed, panel, gallery, custom, and support-hours colour fields nullable across schemas and Go models. Update panel embed mapping and custom-colour batch writes to preserve NULL values and return row errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:breaking Breaking Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant