Skip to content

Commit

Permalink
[PORT] ezdb - A one click script to quickly setting up a development …
Browse files Browse the repository at this point in the history
…database (#1366)

* ezdb - A one click script to quickly setting up a development database (tgstation#75053)

https://user-images.githubusercontent.com/35135081/235344815-8e825ba9-52cf-44e8-b8e2-a2aeb5d47276.mp4

- Downloads a portable MariaDB (doesn't pollute your main system)
- Sets up a database with a random password on port 1338 (configurable)
- Installs the initial schema
- Every time after, will run updates

Major versions right now explicitly escape hatch, because those
historically come with something like a Python script, and I do not want
it to pretend to work.

---------

Co-authored-by: san7890 <the@san7890.com>

* Comment out /tg/ contributors from CODEOWNERS

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
  • Loading branch information
3 people committed Mar 10, 2024
1 parent c35a737 commit 1798371
Show file tree
Hide file tree
Showing 22 changed files with 618 additions and 138 deletions.
245 changes: 123 additions & 122 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,200 +8,201 @@

# Dominion/Cyberboss

/.github/workflows/update_tgs_dmapi.yml @Cyberboss
/.tgs.yml @Cyberboss
/code/world.dm @Cyberboss
/code/__DEFINES/tgs.config.dm @Cyberboss
/code/__DEFINES/tgs.dm @Cyberboss
/code/__DEFINES/_globals.dm @Cyberboss
/code/__HELPERS/chat.dm @Cyberboss
/code/__HELPERS/jatum.dm @Cyberboss
/code/game/world.dm @Cyberboss
/code/controllers/subsystem/atoms.dm @Cyberboss
/code/controllers/globals.dm @Cyberboss
/code/datums/helper_datums/getrev.dm @Cyberboss
/code/modules/tgs/ @Cyberboss
/code/ze_genesis_call/ @Cyberboss
/tools/tgs_test/ @Cyberboss
#/.github/workflows/update_tgs_dmapi.yml @Cyberboss
#/.tgs.yml @Cyberboss
#/code/world.dm @Cyberboss
#/code/__DEFINES/tgs.config.dm @Cyberboss
#/code/__DEFINES/tgs.dm @Cyberboss
#/code/__DEFINES/_globals.dm @Cyberboss
#/code/__HELPERS/chat.dm @Cyberboss
#/code/__HELPERS/jatum.dm @Cyberboss
#/code/game/world.dm @Cyberboss
#/code/controllers/subsystem/atoms.dm @Cyberboss
#/code/controllers/globals.dm @Cyberboss
#/code/datums/helper_datums/getrev.dm @Cyberboss
#/code/modules/tgs/ @Cyberboss
#/code/ze_genesis_call/ @Cyberboss
#/tools/tgs_test/ @Cyberboss


# Fikou

/code/modules/awaymissions/ @Fikou
/code/modules/mining/ @Fikou
/code/modules/mod/ @Fikou
/code/modules/mapfluff/ruins/lavalandruin_code/ @Fikou
/code/modules/mapfluff/ruins/lavaland_ruin_code.dm @Fikou
#/code/modules/awaymissions/ @Fikou
#/code/modules/mining/ @Fikou
#/code/modules/mod/ @Fikou
#/code/modules/mapfluff/ruins/lavalandruin_code/ @Fikou
#/code/modules/mapfluff/ruins/lavaland_ruin_code.dm @Fikou

# JohnFulpWizard

/code/modules/mob/living/simple_animal/bot/ @JohnFulpWillard
/code/modules/modular_computers/ @JohnFulpWillard
#/code/modules/mob/living/simple_animal/bot/ @JohnFulpWillard
#/code/modules/modular_computers/ @JohnFulpWillard

# Kylerace

/code/__DEFINES/spatial_gridmap.dm @Kylerace
/code/controllers/subsystem/spatial_gridmap.dm @Kylerace
#/code/__DEFINES/spatial_gridmap.dm @Kylerace
#/code/controllers/subsystem/spatial_gridmap.dm @Kylerace

# LemonInTheDark

/.github/guides/VISUALS.md @LemonInTheDark
/code/_onclick/hud/ @LemonInTheDark
/code/__DEFINES/layers.dm @LemonInTheDark
#/.github/guides/VISUALS.md @LemonInTheDark
#/code/_onclick/hud/ @LemonInTheDark
#/code/__DEFINES/layers.dm @LemonInTheDark

# Mothblocks

/.github/workflows/ @Mothblocks
/code/game/gamemodes/ @Mothblocks
/code/modules/autowiki/ @Mothblocks
/code/modules/unit_tests/ @Mothblocks
/code/modules/client/preferences/ @Mothblocks
/code/modules/client/preferences_menu.dm @Mothblocks
/tgui/packages/tgui/interfaces/PreferencesMenu/ @Mothblocks
/tools/maplint/source/ @Mothblocks
/tools/pull_request_hooks/ @Mothblocks
/tools/screenshot-test-comparison/ @Mothblocks
/tools/test_merge_bot/ @Mothblocks
#/.github/workflows/ @Mothblocks
#/code/game/gamemodes/ @Mothblocks
#/code/modules/autowiki/ @Mothblocks
#/code/modules/unit_tests/ @Mothblocks
#/code/modules/client/preferences/ @Mothblocks
#/code/modules/client/preferences_menu.dm @Mothblocks
#/tgui/packages/tgui/interfaces/PreferencesMenu/ @Mothblocks
#/tools/ezdb/ @Mothblocks
#/tools/maplint/source/ @Mothblocks
#/tools/pull_request_hooks/ @Mothblocks
#/tools/screenshot-test-comparison/ @Mothblocks
#/tools/test_merge_bot/ @Mothblocks

# MrMelbert

/code/modules/hydroponics/ @MrMelbert
#/code/modules/hydroponics/ @MrMelbert

# ninjanomnom

/code/__DEFINES/dcs/ @ninjanomnom
/code/controllers/subsystem/dcs.dm @ninjanomnom
/code/controllers/subsystem/shuttle.dm @ninjanomnom
/code/datums/components/ @ninjanomnom
/code/datums/elements/ @ninjanomnom
/code/modules/shuttle/ @ninjanomnom
#/code/__DEFINES/dcs/ @ninjanomnom
#/code/controllers/subsystem/dcs.dm @ninjanomnom
#/code/controllers/subsystem/shuttle.dm @ninjanomnom
#/code/datums/components/ @ninjanomnom
#/code/datums/elements/ @ninjanomnom
#/code/modules/shuttle/ @ninjanomnom

# Ryll-Ryll/Shaps

/code/datums/wounds/ @Ryll-Ryll
/code/datums/status_effects/wound_effects.dm @Ryll-Ryll
/code/__DEFINES/wounds.dm @Ryll-Ryll
#/code/datums/wounds/ @Ryll-Ryll
#/code/datums/status_effects/wound_effects.dm @Ryll-Ryll
#/code/__DEFINES/wounds.dm @Ryll-Ryll

# san7890

/code/game/area/ @san7890
/icons/area/ @san7890
#/code/game/area/ @san7890
#/icons/area/ @san7890

# stylemistake

/code/__DEFINES/chat.dm @stylemistake
/code/__DEFINES/tgui.dm @stylemistake
/code/controllers/subsystem/chat.dm @stylemistake
/code/controllers/subsystem/ping.dm @stylemistake
/code/controllers/subsystem/tgui.dm @stylemistake
/code/modules/tgchat/ @stylemistake
/code/modules/tgui/ @stylemistake
/code/modules/tgui_panel/ @stylemistake
/tgui/ @stylemistake
#/code/__DEFINES/chat.dm @stylemistake
#/code/__DEFINES/tgui.dm @stylemistake
#/code/controllers/subsystem/chat.dm @stylemistake
#/code/controllers/subsystem/ping.dm @stylemistake
#/code/controllers/subsystem/tgui.dm @stylemistake
#/code/modules/tgchat/ @stylemistake
#/code/modules/tgui/ @stylemistake
#/code/modules/tgui_panel/ @stylemistake
#/tgui/ @stylemistake

# stylemistake (explicitly disowned)

/tgui/packages/tgui/interfaces/
/tgui/packages/tgui/styles/interfaces/
/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss
/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss
#/tgui/packages/tgui/interfaces/
#/tgui/packages/tgui/styles/interfaces/
#/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss
#/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss

# SuperNovaa41

/code/modules/forensics/ @SuperNovaa41
/code/datums/mood.dm @SuperNovaa41
#/code/modules/forensics/ @SuperNovaa41
#/code/datums/mood.dm @SuperNovaa41

# Time-Green

/code/modules/plumbing/ @Time-Green
/code/modules/surgery/organs/external/ @Time-Green
#/code/modules/plumbing/ @Time-Green
#/code/modules/surgery/organs/external/ @Time-Green

# tralezab
/code/__DEFINES/basic_mobs.dm @tralezab
/code/datums/ai @tralezab
/code/modules/mob/living/basic/ @tralezab
#/code/__DEFINES/basic_mobs.dm @tralezab
#/code/datums/ai @tralezab
#/code/modules/mob/living/basic/ @tralezab

# Watermelon914

/code/modules/wiremod/ @Watermelon914
/code/modules/antagonists/traitor/ @Watermelon914
#/code/modules/wiremod/ @Watermelon914
#/code/modules/antagonists/traitor/ @Watermelon914

# ZephyrTFA

/code/__HELPERS/admin_verb.dm @ZephyrTFA
/code/controllers/subsystem/admin_verbs.dm @ZephyrTFA
/code/datums/json_savefile.dm @ZephyrTFA
/code/datums/armor/ @ZephyrTFA
/code/modules/admin/verbs/ @ZephyrTFA
/code/modules/logging/ @ZephyrTFA
#/code/__HELPERS/admin_verb.dm @ZephyrTFA
#/code/controllers/subsystem/admin_verbs.dm @ZephyrTFA
#/code/datums/json_savefile.dm @ZephyrTFA
#/code/datums/armor/ @ZephyrTFA
#/code/modules/admin/verbs/ @ZephyrTFA
#/code/modules/logging/ @ZephyrTFA


# CONTRIBUTORS

# Cobby

/code/modules/reagents/ @ExcessiveUseOfCobblestone
/code/modules/research/designs/medical_designs.dm @ExcessiveUseOfCobblestone
/code/game/objects/items/storage/medkit.dm @ExcessiveUseOfCobblestone
#/code/modules/reagents/ @ExcessiveUseOfCobblestone
#/code/modules/research/designs/medical_designs.dm @ExcessiveUseOfCobblestone
#/code/game/objects/items/storage/medkit.dm @ExcessiveUseOfCobblestone

# Jordie0608

/SQL/ @Jordie0608
/code/controllers/subsystem/dbcore.dm @Jordie0608
/tools/SQLAlertEmail/ @Jordie0608
#/SQL/ @Jordie0608
#/code/controllers/subsystem/dbcore.dm @Jordie0608
#/tools/SQLAlertEmail/ @Jordie0608

# Kapu1178

/code/modules/surgery/bodyparts/ @Kapu1178
/code/modules/surgery/organs/ @Kapu1178
/code/modules/mob/living/carbon/carbon_update_icons.dm @Kapu1178
/code/modules/mob/living/carbon/human/human_update_icons.dm @Kapu1178
#/code/modules/surgery/bodyparts/ @Kapu1178
#/code/modules/surgery/organs/ @Kapu1178
#/code/modules/mob/living/carbon/carbon_update_icons.dm @Kapu1178
#/code/modules/mob/living/carbon/human/human_update_icons.dm @Kapu1178

# MrStonedOne

/SQL/database_changelog.txt @MrStonedOne
/code/__DEFINES/MC.dm @MrStonedOne
/code/controllers/admin.dm @MrStonedOne
/code/controllers/master.dm @MrStonedOne
/code/controllers/failsafe.dm @MrStonedOne
/code/controllers/subsystem.dm @MrStonedOne
/code/controllers/subsystem/timer.dm @MrStonedOne
/code/controllers/configuration/entries @MrStonedOne
/config/ @MrStonedOne
#/SQL/database_changelog.txt @MrStonedOne
#/code/__DEFINES/MC.dm @MrStonedOne
#/code/controllers/admin.dm @MrStonedOne
#/code/controllers/master.dm @MrStonedOne
#/code/controllers/failsafe.dm @MrStonedOne
#/code/controllers/subsystem.dm @MrStonedOne
#/code/controllers/subsystem/timer.dm @MrStonedOne
#/code/controllers/configuration/entries @MrStonedOne
#/config/ @MrStonedOne

# NamelessFairy

/code/modules/capture_the_flag/ @NamelessFairy
/_maps/map_files/CTF/ @NamelessFairy
#/code/modules/capture_the_flag/ @NamelessFairy
#/_maps/map_files/CTF/ @NamelessFairy

# Pickle-Coding

/code/__DEFINES/atmospherics/ @Pickle-Coding
/code/__DEFINES/reactions.dm @Pickle-Coding
/code/modules/atmospherics/ @Pickle-Coding
/code/modules/power/ @Pickle-Coding
#/code/__DEFINES/atmospherics/ @Pickle-Coding
#/code/__DEFINES/reactions.dm @Pickle-Coding
#/code/modules/atmospherics/ @Pickle-Coding
#/code/modules/power/ @Pickle-Coding

# MULTIPLE OWNERS

/_maps/ @EOBGames @Maurukas @MMMiracles @san7890 @ShizCalev
/icons/ @Imaginos16 @Krysonism @Twaticus
/icons/ass/ @Ghilker @tralezab

/code/__DEFINES/atmospherics/ @Ghilker @LemonInTheDark
/code/__HELPERS/logging/ @dragomagol @ZephyrTFA
/code/controllers/subsystem/air.dm @LemonInTheDark @MrStonedOne
/code/modules/atmospherics/ @Ghilker @LemonInTheDark
/code/modules/client/preferences.dm @Mothblocks @ZephyrTFA
/code/modules/client/preferences_savefile.dm @Mothblocks @ZephyrTFA
/code/modules/jobs/job_types/chief_medical_officer.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
/code/modules/jobs/job_types/medical_doctor.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
/code/modules/jobs/job_types/paramedic.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
/code/modules/surgery/ @ExcessiveUseOfCobblestone @Ryll-Ryll
/tools/build/ @MrStonedOne @stylemistake
/tools/tgs_scripts/ @Cyberboss @MrStonedOne

/tools/WebhookProcessor/ @BraveMole @TiviPlus
#/_maps/ @EOBGames @Maurukas @MMMiracles @san7890 @ShizCalev
#/icons/ @Imaginos16 @Krysonism @Twaticus
#/icons/ass/ @Ghilker @tralezab

#/code/__DEFINES/atmospherics/ @Ghilker @LemonInTheDark
#/code/__HELPERS/logging/ @dragomagol @ZephyrTFA
#/code/controllers/subsystem/air.dm @LemonInTheDark @MrStonedOne
#/code/modules/atmospherics/ @Ghilker @LemonInTheDark
#/code/modules/client/preferences.dm @Mothblocks @ZephyrTFA
#/code/modules/client/preferences_savefile.dm @Mothblocks @ZephyrTFA
#/code/modules/jobs/job_types/chief_medical_officer.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
#/code/modules/jobs/job_types/medical_doctor.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
#/code/modules/jobs/job_types/paramedic.dm @ExcessiveUseOfCobblestone @Ryll-Ryll
#/code/modules/surgery/ @ExcessiveUseOfCobblestone @Ryll-Ryll
#/tools/build/ @MrStonedOne @stylemistake
#/tools/tgs_scripts/ @Cyberboss @MrStonedOne

#/tools/WebhookProcessor/ @BraveMole @TiviPlus

# SIC SEMPER TYRANNIS

/code/modules/hydroponics/grown/citrus.dm @optimumtact
#/code/modules/hydroponics/grown/citrus.dm @optimumtact
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ Things you **CAN'T** do:
- [Hard Deletes](./guides/HARDDELETES.md)
- [MC Tab Guide](./guides/MC_tab.md)
- [Policy Configuration System](./guides/POLICYCONFIG.md)
- [Splitting up pull requests, aka atomization](./guides/ATOMIZATION.md)
- [Quickly setting up a development database with ezdb](./guides/EZDB.md)
- [Required Tests (Continuous Integration)](./guides/CI.md)
- [Splitting up pull requests, aka atomization](./guides/ATOMIZATION.md)
- [UI Development](../tgui/README.md)
- [Visual Effects and Systems](./guides/VISUALS.md)

Expand Down
12 changes: 12 additions & 0 deletions .github/guides/EZDB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Quickly setting up a development database with ezdb
While you do not need a database to code for tgstation, it is a prerequisite to many important features, especially on the admin side. Thus, if you are working in any code that benefits from it, it can be helpful to have one handy.

**ezdb** is a tool for quickly setting up an isolated development database. It will manage downloading MariaDB, creating the database, setting it up, and updating it when the code evolves. It is not recommended for use in production servers, but is perfect for quick development.

To run ezdb, go to `tools/ezdb`, and double-click on ezdb.bat. This will set up the database on port 1338, but you can configure this with `--port`. When it is done, you should be able to launch tgstation as normal and have database access. This runs on the same Python bootstrapper as things like the map merge tool, which can sometimes be flaky.

If you wish to delete the ezdb database, delete the `db` folder as well as `config/ezdb.txt`.

To update ezdb, run the script again. This will both look for any updates in the database changelog, as well as update your schema revision.

Contact Mothblocks if you face any issues in this process.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,7 @@ define_sanity_output.txt
#This file contains developer-specific config overrides. These shouldn't be committed.
config/_config_nogit.txt
config/dbconfig.txt

# ezdb
/db/
/config/ezdb.txt

0 comments on commit 1798371

Please sign in to comment.