get5loader icon indicating copy to clipboard operation
get5loader copied to clipboard

[DB] Refactoring table structs

Open FlowingSPDG opened this issue 5 years ago • 2 comments

This would be heavy-breaking change perhaps. There's several reasons why I want to change it :

  1. team player list(team/auths) is Python2.7 's exported array binary file. which is horrible to handle with Golang. #39
  2. Get5 supports a lot of options to configure match such as cvars, side_type. but some of them are static #134
  3. Support PhlexPlexico/get5-web style season options, vetoes, demo management.

Changes for 1, this should be camma-separated strings insted of binary. https://github.com/splewis/get5-web/issues/175 Changes for 2, type MatchConfig struct and match table needs more colmns(e.g. cvars) Changes for 3, I probably need to add new table for season, and new colmn for veto/demo.

I need to create 2 Migration binaries for original get5-web users and new get5-web-go user.

FlowingSPDG avatar Feb 11 '20 10:02 FlowingSPDG

If you want to keep compatibility with people for drop-in replacements, I would recommend just creating a new table that has FK to team and steam ID. Keeps the database normalised, and allows you to include a new column for custom names during the match. That way you can check if it exists, if it fails, grab from the old PickleType then move each ID it into the new table, maybe?

PhlexPlexico avatar Feb 11 '20 13:02 PhlexPlexico

yeah thats better,I dont want to "change" current structs,I wanna add something insted. but for now get5-web-go is not handling ForeignKey correctly(#11). So I shoulda fix it first :/

edit : nvm,I just solved FK thing :P

FlowingSPDG avatar Feb 11 '20 14:02 FlowingSPDG