mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
"""042_data_training
|
|
|
|
Revision ID: a487d9c69341
|
|
Revises: c4c3c36b720d
|
|
Create Date: 2025-09-15 15:41:43.332771
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlmodel.sql.sqltypes
|
|
from sqlalchemy.dialects import postgresql
|
|
import pgvector
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'a487d9c69341'
|
|
down_revision = 'c4c3c36b720d'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('data_training',
|
|
sa.Column('id', sa.BigInteger(), sa.Identity(always=True), nullable=False),
|
|
sa.Column('oid', sa.BigInteger(), nullable=True),
|
|
sa.Column('datasource', sa.BigInteger(), nullable=True),
|
|
sa.Column('create_time', sa.DateTime(), nullable=True),
|
|
sa.Column('question', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
|
|
sa.Column('description', sa.Text(), nullable=True),
|
|
sa.Column('embedding', pgvector.sqlalchemy.vector.VECTOR(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.drop_table('data_training')
|
|
# ### end Alembic commands ###
|