mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: modify chat
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ script_location = alembic
|
||||
|
||||
# template used to generate migration files
|
||||
# file_template = %%(rev)s_%%(slug)s
|
||||
file_template = %%(slug)s.py
|
||||
file_template = %%(slug)s
|
||||
|
||||
# timezone to use when rendering the date
|
||||
# within the migration file as well as the filename.
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
"""015_modify_chat
|
||||
|
||||
Revision ID: 02d84523a979
|
||||
Revises: fde8acca6143
|
||||
Create Date: 2025-06-25 15:45:14.968598
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel.sql.sqltypes
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '02d84523a979'
|
||||
down_revision = 'fde8acca6143'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('chat', 'datasource',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('chat', 'datasource',
|
||||
existing_type=sa.INTEGER(),
|
||||
nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
@@ -18,7 +18,7 @@ class Chat(SQLModel, table=True):
|
||||
create_by: int = Field(sa_column=Column(BigInteger, nullable=True))
|
||||
brief: str = Field(max_length=64, nullable=True)
|
||||
chat_type: str = Field(max_length=20, default="chat") # chat, datasource
|
||||
datasource: int = Field(sa_column=Column(Integer, nullable=False))
|
||||
datasource: int = Field(sa_column=Column(Integer, nullable=True))
|
||||
engine_type: str = Field(max_length=64)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user