carlofazioli / cardiathena

A project to study strategies in the game of hearts, using distributed computing, AI, and data analytics.
GNU General Public License v3.0
6 stars 1 forks source link

Database schema revamp #68

Closed davidjha closed 4 years ago

davidjha commented 4 years ago

Description

From the meeting on the 21st, Carlo, Aleks and I went over the database schema. The current database schema could be adjusted to include additional information. New information about the games include a timestamp and agent version number. Other modifications to the schema can include a new game table. The game table tracks the game id, timestamp, and the four agents as foreign keys. The four agents reference an entry in the agent_id in agent's table.

Could there be any additional agent metadata other than the version number? Maybe number of wins?

Current Schema: image New Schema: image

Tasks

davidjha commented 4 years ago

I decided to get rid of initialize_table() and import per-configured tables via a .sql file. I think this has simplified the code quite a bit. The .sql file has been pushed into the database/MySQL folder as cardiathena.sql.

A game_uuid entry has been added as a foreign key in place of game_id in the state table referencing a new entry game_uuid in the game table. I couldn't think of any way of getting the game_id from the state table to reference the game_id in the game table, since its auto-incremented by the MySQL server itself. I could query a id but it would be hard to tell if the states actually belong to that game.