Skip to content

Commit b3c329e

Browse files
committed
feat: alembic 003 for datasource table
1 parent 61aa394 commit b3c329e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""003 add datasource
2+
3+
Revision ID: d116056121c3
4+
Revises: 1c8bcc7e25c8
5+
Create Date: 2025-05-06 15:13:06.058032
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
import sqlmodel.sql.sqltypes
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = 'd116056121c3'
15+
down_revision = '1c8bcc7e25c8'
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.create_table('core_datasource',
23+
sa.Column('id', sa.Integer(), sa.Identity(always=True), nullable=False),
24+
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(length=128), nullable=False),
25+
sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=512), nullable=True),
26+
sa.Column('type', sqlmodel.sql.sqltypes.AutoString(length=64), nullable=False),
27+
sa.Column('configuration', sa.Text(), nullable=True),
28+
sa.Column('create_time', sa.DateTime(timezone=True), nullable=True),
29+
sa.Column('create_by', sa.BigInteger(), nullable=True),
30+
sa.Column('status', sqlmodel.sql.sqltypes.AutoString(length=64), nullable=True),
31+
sa.PrimaryKeyConstraint('id')
32+
)
33+
# ### end Alembic commands ###
34+
35+
36+
def downgrade():
37+
# ### commands auto generated by Alembic - please adjust! ###
38+
op.drop_table('core_datasource')
39+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)