requirement.dev.txt 삭제 .
This commit is contained in:
1 parent
8bb4402b33
commit
ebfa7a15bb
53 files changed
+1560
-1
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
from sqlalchemy.orm import declarative_base
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
||||
from sqlalchemy.sql import text
|
||||
|
||||
from common.enums import DBType
|
||||
|
||||
# 모든 ORM 모델의 베이스. insert 시 isinstance 체크에도 사용된다.
|
||||
MAIN_BASE = declarative_base()
|
||||
|
||||
|
||||
class tbl_account(MAIN_BASE):
|
||||
# 모델이 자신이 속한 논리 DB 를 알려준다 (람다 실행 시 DBType 으로 세션 선택).
|
||||
@staticmethod
|
||||
def DBType():
|
||||
return DBType.MAIN.value
|
||||
|
||||
__tablename__ = "tbl_account"
|
||||
|
||||
uid = Column(Integer, primary_key=True, autoincrement=True)
|
||||
id = Column(String(45), nullable=False, unique=True) # 로그인 ID. 중복 가입 방지 위해 unique.
|
||||
pw = Column(String(255), nullable=False, default="") # bcrypt 해시 저장
|
||||
nickname = Column(String(45), nullable=False, default="")
|
||||
is_blocked = Column(Boolean, nullable=False, default=False)
|
||||
# PostgreSQL UTC now: now() 는 timestamptz 이므로 utc 로 변환해 timestamp 로 저장.
|
||||
last_login_at = Column(DateTime, nullable=False, server_default=text("(now() AT TIME ZONE 'utc')"))
|
||||
create_at = Column(DateTime, server_default=text("(now() AT TIME ZONE 'utc')"))
|
||||
Reference in new issue
Block a user