56 lines
2.3 KiB
Python
56 lines
2.3 KiB
Python
"""init
|
|
|
|
Revision ID: 769f535c9249
|
|
Revises:
|
|
Create Date: 2025-08-08 11:20:05.142049+00:00
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '769f535c9249'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('photos',
|
|
sa.Column('id', sa.UUID(), nullable=False),
|
|
sa.Column('profile_id', sa.UUID(), nullable=False),
|
|
sa.Column('url', sa.String(length=500), nullable=False),
|
|
sa.Column('is_main', sa.Boolean(), nullable=False),
|
|
sa.Column('status', sa.String(length=16), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_photos_profile_id'), 'photos', ['profile_id'], unique=False)
|
|
op.create_table('profiles',
|
|
sa.Column('id', sa.UUID(), nullable=False),
|
|
sa.Column('user_id', sa.UUID(), nullable=False),
|
|
sa.Column('gender', sa.String(length=16), nullable=False),
|
|
sa.Column('birthdate', sa.Date(), nullable=True),
|
|
sa.Column('city', sa.String(length=120), nullable=True),
|
|
sa.Column('bio', sa.Text(), nullable=True),
|
|
sa.Column('languages', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
sa.Column('interests', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
sa.Column('preferences', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
sa.Column('verification_status', sa.String(length=16), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_profiles_user_id'), 'profiles', ['user_id'], unique=False)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_profiles_user_id'), table_name='profiles')
|
|
op.drop_table('profiles')
|
|
op.drop_index(op.f('ix_photos_profile_id'), table_name='photos')
|
|
op.drop_table('photos')
|
|
# ### end Alembic commands ###
|