-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
enhancementImprovement of an already existing featureImprovement of an already existing feature
Description
Currently, it's not very easy to update the bot's SQL schema which is used for strictly-typed relational data. This should be made simpler so that newer releases can update the schema without having to manually open a command-line connection to the database.
I have a few ideas for how this can be done:
- SQL migrations are performed by sending an SQL code block or SQL file into a Discord channel, so that the bot can read the migration script from that.
- Add migrations as SQL files to the bot's resources, so that on startup the bot will look for any migrations to perform.
I'm leaning towards the second option, but in both cases this involves first making a migration table in the database to ensure that we don't try to run a migration that has already been run.
CREATE TABLE migration (
name VARCHAR(255) PRIMARY KEY,
created_at TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
script_hash VARCHAR(1024) NOT NULL,
performed_at TIMESTAMP(0),
performed_by BIGINT,
successful BOOLEAN
);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementImprovement of an already existing featureImprovement of an already existing feature