initial commit
worked on async alembic migrations, User model. Current issue: web_1 | INFO: 172.20.0.1:62958 - "POST /users/ HTTP/1.1" 500 Internal Server Error web_1 | ERROR: Exception in ASGI application web_1 | Traceback (most recent call last): ... web_1 | response web_1 | value is not a valid dict (type=type_error.dict) when trying to create new user
This commit is contained in:
36
migrations/versions/33916b50e076_adds_user_table.py
Normal file
36
migrations/versions/33916b50e076_adds_user_table.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""adds user table
|
||||
|
||||
Revision ID: 33916b50e076
|
||||
Revises:
|
||||
Create Date: 2022-12-18 21:48:43.575781
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '33916b50e076'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.String(), nullable=False),
|
||||
sa.Column('username', sa.String(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_users_created_at'), 'users', ['created_at'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_users_created_at'), table_name='users')
|
||||
op.drop_table('users')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user