alembic 1.2
This commit is contained in:
1
run.py
1
run.py
@@ -3,7 +3,6 @@ from server.backend import endpoints# импортируем FastAPI экзем
|
||||
import asyncio
|
||||
from server.database import db
|
||||
if __name__ == "__main__":
|
||||
#asyncio.run(db.main())
|
||||
uvicorn.run(
|
||||
"server.backend.endpoints:api",
|
||||
host="127.0.0.1",
|
||||
|
||||
@@ -40,9 +40,6 @@ class User(Base):
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
last_login = Column(DateTime(timezone=True))
|
||||
|
||||
# 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))
|
||||
@@ -94,5 +91,3 @@ async def reset_user(user_info):
|
||||
await session.commit()
|
||||
return user
|
||||
return None
|
||||
# async def main():
|
||||
# await init_db()
|
||||
Reference in New Issue
Block a user