Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save hex symbol with color name #979

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Feb 5, 2025

See snapshot-labs/snapshot-sequencer#498 (comment)

This PR will save the # symbol together with the color code, to save extra processing on read and write

Run these SQL queries

ALTER TABLE skins
  MODIFY bg_color VARCHAR(7) DEFAULT NULL,
  MODIFY link_color VARCHAR(7) DEFAULT NULL,
  MODIFY text_color VARCHAR(7) DEFAULT NULL,
  MODIFY content_color VARCHAR(7) DEFAULT NULL,
  MODIFY border_color VARCHAR(7) DEFAULT NULL,
  MODIFY heading_color VARCHAR(7) DEFAULT NULL,
  MODIFY primary_color VARCHAR(7) DEFAULT NULL,
  MODIFY header_color VARCHAR(7) DEFAULT NULL;

UPDATE skins 
SET bg_color = CONCAT('#', bg_color)
WHERE bg_color IS NOT NULL;

UPDATE skins 
SET link_color = CONCAT('#', link_color)
WHERE link_color IS NOT NULL;

UPDATE skins 
SET text_color = CONCAT('#', text_color)
WHERE text_color IS NOT NULL;

UPDATE skins 
SET content_color = CONCAT('#', content_color)
WHERE content_color IS NOT NULL;

UPDATE skins 
SET border_color = CONCAT('#', border_color)
WHERE border_color IS NOT NULL;

UPDATE skins 
SET heading_color = CONCAT('#', heading_color)
WHERE heading_color IS NOT NULL;

UPDATE skins 
SET primary_color = CONCAT('#', primary_color)
WHERE primary_color IS NOT NULL;

UPDATE skins 
SET header_color = CONCAT('#', header_color)
WHERE header_color IS NOT NULL;

@wa0x6e wa0x6e requested a review from ChaituVR February 5, 2025 11:58
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tAck, i will run it on Prod DB and merge

@ChaituVR ChaituVR merged commit 3eab75e into master Feb 5, 2025
2 checks passed
@ChaituVR ChaituVR deleted the save-hex-symbol-with-color-name branch February 5, 2025 17:32
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