Added migration for config in wi #127
This commit is contained in:
33
kdb-bot/src/bot_data/migration/config_migration.py
Normal file
33
kdb-bot/src/bot_data/migration/config_migration.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from bot_core.logging.database_logger import DatabaseLogger
|
||||
from bot_data.abc.migration_abc import MigrationABC
|
||||
from bot_data.db_context import DBContext
|
||||
|
||||
|
||||
class ConfigMigration(MigrationABC):
|
||||
name = "1.1.0_ConfigMigration"
|
||||
|
||||
def __init__(self, logger: DatabaseLogger, db: DBContext):
|
||||
MigrationABC.__init__(self)
|
||||
self._logger = logger
|
||||
self._db = db
|
||||
self._cursor = db.cursor
|
||||
|
||||
def upgrade(self):
|
||||
self._logger.debug(__name__, "Running upgrade")
|
||||
|
||||
# self._cursor.execute(
|
||||
# str(
|
||||
# f"""
|
||||
# CREATE TABLE IF NOT EXISTS `Config` (
|
||||
# `Id` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
# `CreatedAt` DATETIME(6),
|
||||
# `LastModifiedAt` DATETIME(6),
|
||||
# PRIMARY KEY(`Id`)
|
||||
# );
|
||||
# """
|
||||
# )
|
||||
# )
|
||||
|
||||
def downgrade(self):
|
||||
self._logger.debug(__name__, "Running downgrade")
|
||||
# self._cursor.execute("DROP TABLE `Config`;")
|
Reference in New Issue
Block a user