-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecklist.py
More file actions
17 lines (14 loc) · 830 Bytes
/
checklist.py
File metadata and controls
17 lines (14 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from sqlalchemy import Column, Integer, String, Boolean, TIMESTAMP, ForeignKey, text
from sqlalchemy.orm import relationship
from .base import Base
class Checklist(Base):
__tablename__ = "checklist"
id = Column(Integer, primary_key=True, autoincrement=True)
user_id = Column(Integer, ForeignKey("user.u_id", ondelete="CASCADE"), nullable=False)
title = Column(String(255), nullable=False)
is_clear = Column(Boolean, nullable=False, server_default=text("0"))
created_at = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
updated_at = Column(TIMESTAMP, nullable=False,
server_default=text("CURRENT_TIMESTAMP"),
onupdate=text("CURRENT_TIMESTAMP"))
user = relationship("User", back_populates="checklists")