Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Saturn99X_Etherion /alembic /versions /8747b1bc101a_initial_migration.py
| """Initial migration | |
| Revision ID: 8747b1bc101a | |
| Revises: | |
| Create Date: 2025-08-04 21:25:53.327234 | |
| """ | |
| from typing import Sequence, Union | |
| from alembic import op | |
| import sqlalchemy as sa | |
| # revision identifiers, used by Alembic. | |
| revision: str = '8747b1bc101a' | |
| down_revision: Union[str, Sequence[str], None] = None | |
| branch_labels: Union[str, Sequence[str], None] = None | |
| depends_on: Union[str, Sequence[str], None] = None | |
| def upgrade() -> None: | |
| """Upgrade schema.""" | |
| # ### commands auto generated by Alembic - please adjust! ### | |
| op.create_table('user', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('user_id', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| op.create_index(op.f('ix_user_user_id'), 'user', ['user_id'], unique=True) | |
| op.create_table('project', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('name', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.Column('user_id', sa.Integer(), nullable=False), | |
| sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| op.create_table('toneprofile', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('name', sa.String(), nullable=False), | |
| sa.Column('profile_text', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.Column('user_id', sa.Integer(), nullable=False), | |
| sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| op.create_table('conversation', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('title', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.Column('project_id', sa.Integer(), nullable=False), | |
| sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| op.create_table('projectkbfile', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('file_name', sa.String(), nullable=False), | |
| sa.Column('file_uri', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.Column('project_id', sa.Integer(), nullable=False), | |
| sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| op.create_table('message', | |
| sa.Column('id', sa.Integer(), nullable=False), | |
| sa.Column('role', sa.String(), nullable=False), | |
| sa.Column('content', sa.String(), nullable=False), | |
| sa.Column('created_at', sa.DateTime(), nullable=False), | |
| sa.Column('conversation_id', sa.Integer(), nullable=False), | |
| sa.ForeignKeyConstraint(['conversation_id'], ['conversation.id'], ), | |
| sa.PrimaryKeyConstraint('id') | |
| ) | |
| # ### end Alembic commands ### | |
| def downgrade() -> None: | |
| """Downgrade schema.""" | |
| # ### commands auto generated by Alembic - please adjust! ### | |
| op.drop_table('message') | |
| op.drop_table('projectkbfile') | |
| op.drop_table('conversation') | |
| op.drop_table('toneprofile') | |
| op.drop_table('project') | |
| op.drop_index(op.f('ix_user_user_id'), table_name='user') | |
| op.drop_table('user') | |
| # ### end Alembic commands ### | |
Xet Storage Details
- Size:
- 3.26 kB
- Xet hash:
- 4e9cf0627f58befc7b701616a55e7ad7869b69aa0cfb27d2c3219a4c06d4d492
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.