Lost-in-the-Idea / tier-list-creator

MIT License
1 stars 0 forks source link

Create initial Tierlist database structure #4

Open Snappey opened 1 week ago

Snappey commented 1 week ago

Create table structure and updating seed functions to new structure.

Create a model for each of the below, Tierlist has many Tiers and has many Items so should be represented as an array on the Tierlist model.

- Tierlist
    - Name
    - Description
    - Creator # Foreign Key reference to Users table
    - Tiers # Foreign Key reference to Tiers table
    - Items # Foreign Key reference to Items table
    - Version # int starting from 1

- Tiers
  - TierlistId 
  - Text
  - Colour

- Items
  - TierlistId 
  - Text
  - Image  
  - Tier

Update seed functions to reflect new structure, should include some tiers and items.

Snappey commented 1 week ago

Currently Tierlist models are in models/user.go as part of this change, move them into their own file tierlist.go

Rizq0 commented 6 days ago

Added the structs + basic seeding that seems to be working. Will run through your vision with the Tiers / Items tables when you get a moment just to confirm the structure and links.

My understanding is that each tier created in the tiers table will reference which tierlist it relates to and what items relate to it. Then each item in the items table references which tier it currently sits at and which tierlist it relates to.

Is that the basic thinking?

Snappey commented 6 days ago

Yeah that's correct, reading your explanation we coud potentially simplify this a little and remove the relationship from items -> tierlist since we can infer that from the tier the item is linked to.

Rizq0 commented 5 days ago

I am currently at the stage now where I have committed the structs and some seed data.

Next step would be to determine what data we want seeded. I have added some basic table fillers, but is there anything specific we want?