Sketching out the database

Lacuna • July 18, 2022

Since I have only a very rough idea of where this project is going, I decided to rustle up some code, but first, I need some tables.

For brevity, I'm only going to build just the tables & columns that I need at this stage, this will hopefully keep things a little cleaner, easier to understand, and I suspect, help me out with testing at a later stage.

Users

This will hold user account information only - So email, password, etc, and potentially billing information if the system yields the possibility of charging for certain in-game elements. Initially, I'll also store an is_staff flag here which would grant that user access to some form of control panel though I suspect I may need far more granular permissions but that can be addressed later down the line.

Note that I'm not using a username here; I'm just using Laravel's out-of-the-box users table and will add to that in due course. If you want to use username to authenticate users, it's a very simple modification to make at this stage.

Players

This holds all the player specific information related to the game and has a one-to-one relationship with the users table. This will allow players to kill off their existing player and start afresh without losing their account information, it also allows me to create NPC players at will; though at the moment I'm not sure what I'll use them for.

Wrapping up

The database at this stage, ignoring Laravel's built-in tables is fairly plain, but this is sufficient for the next stage.

Schema 1