login
This commit is contained in:
50
migrations/versions/0bcf54a7f2a7_bigger.py
Normal file
50
migrations/versions/0bcf54a7f2a7_bigger.py
Normal file
@@ -0,0 +1,50 @@
|
||||
"""bigger
|
||||
|
||||
Revision ID: 0bcf54a7f2a7
|
||||
Revises: 28e8e0be0355
|
||||
Create Date: 2025-08-03 22:22:24.361337
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0bcf54a7f2a7'
|
||||
down_revision = '28e8e0be0355'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.alter_column('first_name',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=False)
|
||||
batch_op.alter_column('last_name',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=False)
|
||||
batch_op.alter_column('password_hash',
|
||||
existing_type=postgresql.BYTEA(),
|
||||
type_=sa.String(length=2048),
|
||||
nullable=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.alter_column('password_hash',
|
||||
existing_type=sa.String(length=2048),
|
||||
type_=postgresql.BYTEA(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('last_name',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=True)
|
||||
batch_op.alter_column('first_name',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=True)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,42 @@
|
||||
"""Add first_name, last_name, and timestamp fields to User model
|
||||
|
||||
Revision ID: 28e8e0be0355
|
||||
Revises: 02a7c13515a4
|
||||
Create Date: 2025-08-03 22:05:17.318228
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '28e8e0be0355'
|
||||
down_revision = '02a7c13515a4'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('first_name', sa.String(length=255), nullable=True))
|
||||
batch_op.add_column(sa.Column('last_name', sa.String(length=255), nullable=True))
|
||||
batch_op.add_column(sa.Column('created_at', sa.DateTime(), nullable=True))
|
||||
batch_op.add_column(sa.Column('updated_at', sa.DateTime(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.alter_column('password_hash',
|
||||
existing_type=postgresql.BYTEA(),
|
||||
nullable=True)
|
||||
batch_op.drop_column('updated_at')
|
||||
batch_op.drop_column('created_at')
|
||||
batch_op.drop_column('last_name')
|
||||
batch_op.drop_column('first_name')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user