mirror of
https://github.com/aykhans/portfolio-blog.git
synced 2025-09-08 15:10:45 +00:00
- Added flake8
- create_user moved to commands
This commit is contained in:
@@ -1 +1 @@
|
||||
from app.db.base_class import Base
|
||||
from app.db.base_class import Base
|
||||
|
@@ -16,10 +16,14 @@ class Base:
|
||||
__name__: str
|
||||
|
||||
id: Any
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
|
||||
created_at = Column(
|
||||
DateTime(timezone=True),
|
||||
server_default=func.now(),
|
||||
nullable=False
|
||||
)
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# Generate __tablename__ automatically
|
||||
@declared_attr
|
||||
def __tablename__(cls) -> str:
|
||||
return cls.__name__.lower()
|
||||
return cls.__name__.lower()
|
||||
|
@@ -34,4 +34,4 @@ AsyncSessionLocal: AsyncSession = sessionmaker(
|
||||
autoflush=False,
|
||||
bind=async_engine,
|
||||
class_=AsyncSession
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user