PretendoNetwork / friends

Pretendo Network friends server
GNU Affero General Public License v3.0
27 stars 7 forks source link

feat: Update modules and new Mii database fields #19

Closed DaniElectra closed 2 months ago

DaniElectra commented 2 months ago

Add Mii profanity flag and character set to the 3DS friends database. This in theory allows better support of Mii names that use characters exclusive to the following regions: CHN, KOR or TWN.

Also get the Mii changed timestamp from the database, and not use the current time for it.

Update the go modules to get the latest stability updates and use the new fields on the Mii structure.

Required the following query to be run for migration:

Query ``` ALTER TABLE "3ds".user_data ADD mii_profanity integer DEFAULT FALSE, ADD mii_character_set integer DEFAULT 0; UPDATE "3ds".user_data SET mii_profanity = FALSE WHERE mii_profanity IS NULL; UPDATE "3ds".user_data SET mii_character_set = 0 WHERE mii_character_set IS NULL; ```
jonbarrow commented 2 months ago

lgtm

MatthewL246 commented 1 month ago

It looks like there's a typo in the migration query here.

ADD mii_profanity integer DEFAULT FALSE,

It should be boolean.

ALTER TABLE "3ds".user_data
ADD mii_profanity boolean DEFAULT FALSE,
ADD mii_character_set integer DEFAULT 0;

UPDATE "3ds".user_data SET mii_profanity = FALSE WHERE mii_profanity IS NULL;
UPDATE "3ds".user_data SET mii_character_set = 0 WHERE mii_character_set IS NULL;
jonbarrow commented 1 month ago

Yes but this was already handled a month ago

MatthewL246 commented 1 month ago

It was handled for you, but I'm documenting it for others who might be migrating to nex-go-rewrite (me).

jonbarrow commented 1 month ago

I assume people can figure that out, considering it's always treated as a bool. It's not a difficult thing to see and fix. Postgres won't even let you run the query as-is

This migration is also only really needed by people migrating existing servers, which is basically no one. Everyone else will just have the tables setup correctly