feat: Backend i18n

This commit is contained in:
fit2cloud-chenyw
2025-07-07 14:16:05 +08:00
parent cd26d6594e
commit 17fd6ffbf7
8 changed files with 124 additions and 9 deletions
+20 -2
View File
@@ -7,7 +7,7 @@ Create Date: 2025-07-06 18:03:36.143060
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlmodel import BigInteger, String, column, table
# revision identifiers, used by Alembic.
@@ -25,8 +25,26 @@ def upgrade():
sa.Column('create_time', sa.BigInteger(), default=0, nullable=False)
)
op.create_index(op.f('ix_sys_workspace_id'), 'sys_workspace', ['id'], unique=False)
accounts_table = table(
"sys_workspace",
column("id", BigInteger),
column("name", String),
column("create_time", BigInteger),
)
op.bulk_insert(
accounts_table,
[
{
"id": 1,
"name": "i18n_default_workspace",
"create_time": 1672531199000
}
]
)
def downgrade():
op.drop_table('sys_workspace')
op.drop_index(op.f('ix_sys_workspace_id'), table_name='sys_workspace')
op.drop_table('sys_workspace')