mirror of
https://github.com/testdrivenio/fastapi-sqlmodel-alembic.git
synced 2025-08-14 09:07:27 +08:00
16 lines
296 B
Python
16 lines
296 B
Python
from sqlmodel import SQLModel, Field
|
|
from typing import Optional
|
|
|
|
|
|
class SongBase(SQLModel):
|
|
name: str
|
|
artist: str
|
|
year: Optional[int] = None
|
|
|
|
|
|
class Song(SongBase, table=True):
|
|
id: int = Field(default=None, nullable=False, primary_key=True)
|
|
|
|
|
|
class SongCreate(SongBase):
|
|
pass |