This commit is contained in:
51
migrations/versions/4f0e54d29f32_initial_migration.py
Normal file
51
migrations/versions/4f0e54d29f32_initial_migration.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""Initial migration
|
||||
|
||||
Revision ID: 4f0e54d29f32
|
||||
Revises:
|
||||
Create Date: 2025-06-28 05:39:12.793761
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4f0e54d29f32'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('user',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('username', sa.String(length=80), nullable=False),
|
||||
sa.Column('password_hash', sa.String(length=128), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('username')
|
||||
)
|
||||
op.create_table('user_config',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('rms_host', sa.String(length=200), nullable=True),
|
||||
sa.Column('rms_login', sa.String(length=100), nullable=True),
|
||||
sa.Column('rms_password_encrypted', sa.LargeBinary(), nullable=True),
|
||||
sa.Column('google_cred_file_path', sa.String(length=300), nullable=True),
|
||||
sa.Column('google_sheet_url', sa.String(length=300), nullable=True),
|
||||
sa.Column('google_client_email', sa.String(length=200), nullable=True),
|
||||
sa.Column('mappings_json', sa.Text(), nullable=True),
|
||||
sa.Column('presets_json', sa.Text(), nullable=True),
|
||||
sa.Column('sheets_json', sa.Text(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('user_id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('user_config')
|
||||
op.drop_table('user')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user