alembic 1.1

This commit is contained in:
2025-10-01 12:24:09 +03:00
parent 5deffdfcf1
commit 28a853c865
3 changed files with 6 additions and 39 deletions

View File

@@ -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()