File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ script_location = alembic
66
77# template used to generate migration files
88# file_template = %%(rev)s_%%(slug)s
9- file_template = %%(slug)s.py
9+ file_template = %%(slug)s
1010
1111# timezone to use when rendering the date
1212# within the migration file as well as the filename.
Original file line number Diff line number Diff line change 1+ """015_modify_chat
2+
3+ Revision ID: 02d84523a979
4+ Revises: fde8acca6143
5+ Create Date: 2025-06-25 15:45:14.968598
6+
7+ """
8+ from alembic import op
9+ import sqlalchemy as sa
10+ import sqlmodel .sql .sqltypes
11+ from sqlalchemy .dialects import postgresql
12+
13+ # revision identifiers, used by Alembic.
14+ revision = '02d84523a979'
15+ down_revision = 'fde8acca6143'
16+ branch_labels = None
17+ depends_on = None
18+
19+
20+ def upgrade ():
21+ # ### commands auto generated by Alembic - please adjust! ###
22+ op .alter_column ('chat' , 'datasource' ,
23+ existing_type = sa .INTEGER (),
24+ nullable = True )
25+ # ### end Alembic commands ###
26+
27+
28+ def downgrade ():
29+ # ### commands auto generated by Alembic - please adjust! ###
30+ op .alter_column ('chat' , 'datasource' ,
31+ existing_type = sa .INTEGER (),
32+ nullable = False )
33+ # ### end Alembic commands ###
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Chat(SQLModel, table=True):
1818 create_by : int = Field (sa_column = Column (BigInteger , nullable = True ))
1919 brief : str = Field (max_length = 64 , nullable = True )
2020 chat_type : str = Field (max_length = 20 , default = "chat" ) # chat, datasource
21- datasource : int = Field (sa_column = Column (Integer , nullable = False ))
21+ datasource : int = Field (sa_column = Column (Integer , nullable = True ))
2222 engine_type : str = Field (max_length = 64 )
2323
2424
You can’t perform that action at this time.
0 commit comments