From 9f9c676e1d46b059fd8f030f6cc60c966ddb7cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Jia=20=28=E8=B4=BE=E6=80=9D=E7=91=9E=29?= Date: Mon, 12 Jun 2023 16:25:33 +0800 Subject: [PATCH] add new table config in sql init Change-Id: If481c0ba0bb28225f9bbf1e0e5dee1789e081a36 --- venus/db/alembic/versions/a6cf98f55b4d_.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/venus/db/alembic/versions/a6cf98f55b4d_.py b/venus/db/alembic/versions/a6cf98f55b4d_.py index bc6d069..ee71237 100644 --- a/venus/db/alembic/versions/a6cf98f55b4d_.py +++ b/venus/db/alembic/versions/a6cf98f55b4d_.py @@ -61,3 +61,24 @@ def upgrade() -> None: new_data, ], ) + + t_mo_custom_config = op.Table( + 't_mo_custom_config', + op.Column('id', op.String(64), primary_key=True), + op.Column('value', op.String(10240), nullable=False), + op.Column('update_time', op.DateTime), + mysql_engine='InnoDB', + mysql_charset='utf8') + + new_data = { + 'id': 'log_save_days', + 'value': '30', + 'update_time': now + } + + op.bulk_insert( + t_mo_custom_config, + [ + new_data, + ], + )