diff --git a/db-config/README.md b/db-config/README.md new file mode 100755 index 0000000..f5d9cec --- /dev/null +++ b/db-config/README.md @@ -0,0 +1,24 @@ +# dutylog.app DB Schema +This repository will house any initialization scripts, constant data, design notes, and really anything else related to the database. + +## Design Notes +All activities will be stored in our own database for simplicity and so that data can be formatted in a usable setup. Activity names will not be stored in the DB and instead will live in a `[type].[lang].json` file in their game translated forms. + +The current plan is to host this database on Cloudflare D1, which is based on SQLite. + +## Translations +Current translation file list: + +- `language.[lang].json` +- `servers.[lang].json` +- `expansions.[lang].json` +- `instance_types.[lang].json` +- `instances.[lang].json` +- `jobs.[lang].json` + +These files will be generated by the DB initialization script and will need to be moved to the `www` repo for build/deployment. + +## Schema +The schema was designed using [Dia](http://dia-installer.de/). + +![schema.png](https://git.milligan.dev/xivdev/dutylog/raw/branch/main/db-config/schema.png) diff --git a/db-config/schema.dia b/db-config/schema.dia new file mode 100644 index 0000000..1aa7e7b --- /dev/null +++ b/db-config/schema.dia @@ -0,0 +1,2274 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Claimed_Chars# + + + ## + + + + + + + + + + + + + + + + + #discord_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #lodestone_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #server# + + + #VARCHAR(20)# + + + ## + + + + + + + + + + + + ## + + + + + #first_name# + + + #VARCHAR(15)# + + + ## + + + + + + + + + + + + ## + + + + + #last_name# + + + #VARCHAR(15)# + + + ## + + + + + + + + + + + + ## + + + + + #patch# + + + #DOUBLE# + + + ## + + + + + + + + + + + + ## + + + + + #last_refresh# + + + #DATE# + + + ## + + + + + + + + + + + + ## + + + + + #private# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #custom_job_sort# + + + #VARCHAR(200)# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Clears# + + + ## + + + + + + + + + + + + + + + + + #id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #lodestone_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #instance_id# + + + #INT# + + + ## + + + + + + + + + + + + ## + + + + + #job_0# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #date# + + + #DATE# + + + ## + + + + + + + + + + + + ## + + + + + #clear_type# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #verified# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #proof# + + + #VARCHAR(1000)# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Clear_Types# + + + #prefilled with sync and mine# + + + + + + + + + + + + + + + + + #id# + + + #BIGINT# + + + #autoincrement# + + + + + + + + + + + + ## + + + + + #discord_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #name# + + + #VARCHAR(200)# + + + ## + + + + + + + + + + + + ## + + + + + #description# + + + #TEXT# + + + ## + + + + + + + + + + + + ## + + + + + #color# + + + #CHARACTER(6)# + + + ## + + + + + + + + + + + + ## + + + + + #unrestricted# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #min_ilvl# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #no_echo# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #level_sync# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Instances# + + + ## + + + + + + + + + + + + + + + + + #instance_id# + + + #INT# + + + ## + + + + + + + + + + + + ## + + + + + #expansion_id# + + + #INT# + + + ## + + + + + + + + + + + + ## + + + + + #type_id# + + + #INT# + + + ## + + + + + + + + + + + + ## + + + + + #patch# + + + #DOUBLE# + + + ## + + + + + + + + + + + + ## + + + + + #community_nick# + + + #VARCHAR(10)# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Accounts# + + + ## + + + + + + + + + + + + + + + + + #discord_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #lang# + + + #CHARACTER(2)# + + + ## + + + + + + + + + + + + ## + + + + + #hide_locked# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #hide_community_name# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #private# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Verified_Clears# + + + #submitter is not included here# + + + + + + + + + + + + + + + + + #clear_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #unrestricted# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #min_ilvl# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #no_echo# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #level_sync# + + + #TINYINT# + + + ## + + + + + + + + + + + + ## + + + + + #job_1# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_2# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_3# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_4# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_5# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_6# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + #job_7# + + + #CHARACTER(3)# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #View_Settings# + + + ## + + + + + + + + + + + + + + + + + #lodestone_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + #clear_type_id# + + + #BIGINT# + + + ## + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + + + + + + + + #NOTES: +TINYINT is used to store BOOLEANS# + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db-config/schema.png b/db-config/schema.png new file mode 100644 index 0000000..785d12f Binary files /dev/null and b/db-config/schema.png differ