Open Ma-wa-re opened 6 years ago
This will also require manually firing off the on_guild_join
and on_guild_leave
events on cog load/unload if applicable. The difference is done by checking the SQL guilds list with the client's guild list, but the SQL is updated right after the hooks are run. So we'll need to store the diffs in the client somewhere for the entire length of the bot's life.
Remember to update CONTRIBUTING.md
too
Update: As I am currently working on a optional music cog I have added a feature to have a SQL model for this cog where the files to create the tables are in the optional cog's folder and call a function to create/load the tables it needs into the DB.
This would meet the requirements of this issue as the bot is mainly a moderation bot having the SQL models hard coded for the cogs we recommend makes sense and having optional cogs be dynamic as they are not needed to complete this task
@Ma-wa-re Look in to using https://alembic.sqlalchemy.org/en/latest/ as suggested by Jason_000 on discord
Instead of all tables needed for cogs being static and needing added in sql to be made at init time. When a cog is loaded it can request a table to be made for it to make it more dynamic and not require 3rd party devs making cogs to touch the base bot. Doing this will mean tables for cogs that are not being used are created