alembic 1.1
This commit is contained in:
@@ -39,11 +39,10 @@ class User(Base):
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
last_login = Column(DateTime(timezone=True))
|
||||
description2 = Column(String, nullable=True)
|
||||
|
||||
async def init_db():
|
||||
async with async_engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
# async def init_db():
|
||||
# async with async_engine.begin() as conn:
|
||||
# await conn.run_sync(Base.metadata.create_all)
|
||||
async def create_user(user_info):
|
||||
async with AsyncSessionLocal() as session:
|
||||
new_user = User(email=user_info.email, description=user_info.description, activated=user_info.activated, password=hash_password(user_info.password))
|
||||
@@ -95,5 +94,5 @@ async def reset_user(user_info):
|
||||
await session.commit()
|
||||
return user
|
||||
return None
|
||||
async def main():
|
||||
await init_db()
|
||||
# async def main():
|
||||
# await init_db()
|
||||
Reference in New Issue
Block a user