bosch-3671ii/alembic/versions/20250328_055703_0336879d_create_user.py
2025-03-28 05:57:20 -05:00

35 lines
1019 B
Python

"""create users table
Revision ID: 2f3c4d5e6f7a
Revises: 0001
Create Date: 2023-05-23 10:30:00.000000
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.sql import func
# revision identifiers, used by Alembic.
revision = '2f3c4d5e6f7a'
down_revision = '0001'
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'users',
sa.Column('id', UUID(as_uuid=True), primary_key=True, nullable=False),
sa.Column('first_name', sa.String, nullable=False),
sa.Column('last_name', sa.String, nullable=False),
sa.Column('email', sa.String, unique=True, nullable=False),
sa.Column('password', sa.String, nullable=False),
sa.Column('is_active', sa.Boolean, default=True),
sa.Column('created_at', sa.DateTime, server_default=func.now()),
sa.Column('updated_at', sa.DateTime, server_default=func.now(), onupdate=func.now())
)
def downgrade():
op.drop_table('users')