mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 17:57:06 +08:00
feat: License
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""011_license_ddl
|
||||
|
||||
Revision ID: a3af70d43e98
|
||||
Revises: 8dc3b1bdbfef
|
||||
Create Date: 2025-06-18 16:09:33.896600
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a3af70d43e98'
|
||||
down_revision = '8dc3b1bdbfef'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'license',
|
||||
sa.Column('id', sa.BigInteger(), primary_key=True, nullable=False),
|
||||
sa.Column('license_key', sa.Text(), default="", nullable=False),
|
||||
sa.Column('f2c_license', sa.Text(), default="", nullable=False),
|
||||
sa.Column('create_time', sa.BigInteger(), default=0, nullable=False),
|
||||
sa.Column('update_time', sa.BigInteger(), default=0, nullable=False)
|
||||
)
|
||||
op.create_index(op.f('ix_license_id'), 'license', ['id'], unique=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('license')
|
||||
op.drop_index(op.f('ix_license_id'), table_name='license')
|
||||
+2
-1
@@ -15,7 +15,7 @@ from common.core.response_middleware import ResponseMiddleware, exception_handle
|
||||
from alembic.config import Config
|
||||
from alembic import command
|
||||
from fastapi_mcp import FastApiMCP
|
||||
|
||||
import sqlbot_xpack
|
||||
|
||||
def run_migrations():
|
||||
alembic_cfg = Config("alembic.ini")
|
||||
@@ -88,6 +88,7 @@ else:
|
||||
|
||||
mcp.setup_server()
|
||||
|
||||
sqlbot_xpack.init_fastapi_app(app)
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
|
||||
Reference in New Issue
Block a user