|
1 | 1 | from .database import Base
|
2 | 2 | from sqlalchemy import TIMESTAMP, Column, String, Boolean
|
3 | 3 | from sqlalchemy.sql import func
|
4 | | -from fastapi_utils.guid_type import GUID, GUID_SERVER_DEFAULT_POSTGRESQL |
| 4 | +from fastapi_utils.guid_type import GUID, GUID_DEFAULT_SQLITE |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class Note(Base):
|
8 | 8 | __tablename__ = 'notes'
|
9 | | - id = Column(GUID, primary_key=True, |
10 | | - server_default=GUID_SERVER_DEFAULT_POSTGRESQL) |
| 9 | + id = Column(GUID, primary_key=True, default=GUID_DEFAULT_SQLITE) |
11 | 10 | title = Column(String, nullable=False)
|
12 | 11 | content = Column(String, nullable=False)
|
13 | 12 | category = Column(String, nullable=True)
|
14 | | - published = Column(Boolean, nullable=False, server_default='True') |
| 13 | + published = Column(Boolean, nullable=False, default=True) |
15 | 14 | createdAt = Column(TIMESTAMP(timezone=True),
|
16 | 15 | nullable=False, server_default=func.now())
|
17 | 16 | updatedAt = Column(TIMESTAMP(timezone=True),
|
|
0 commit comments