mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-21 15:00:18 +00:00
feat: add common model
This commit is contained in:
parent
a58f97f61b
commit
fe393ff95c
18
src/arcaea_offline/models/common.py
Normal file
18
src/arcaea_offline/models/common.py
Normal file
@ -0,0 +1,18 @@
|
||||
from sqlalchemy import TEXT
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||
|
||||
__all__ = [
|
||||
"CommonBase",
|
||||
"Property",
|
||||
]
|
||||
|
||||
|
||||
class CommonBase(DeclarativeBase):
|
||||
pass
|
||||
|
||||
|
||||
class Property(CommonBase):
|
||||
__tablename__ = "property"
|
||||
|
||||
id: Mapped[str] = mapped_column(TEXT(), primary_key=True)
|
||||
value: Mapped[str] = mapped_column(TEXT())
|
@ -6,6 +6,14 @@ from sqlalchemy_utils import create_view
|
||||
|
||||
from .songs import Chart, ChartInfo
|
||||
|
||||
__all__ = [
|
||||
"ScoresBase",
|
||||
"Score",
|
||||
"Calculated",
|
||||
"Best",
|
||||
"CalculatedPotential",
|
||||
]
|
||||
|
||||
|
||||
class ScoresBase(DeclarativeBase):
|
||||
pass
|
||||
|
@ -3,18 +3,22 @@ from typing import Optional
|
||||
from sqlalchemy import TEXT, ForeignKey
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||
|
||||
__all__ = [
|
||||
"SongsBase",
|
||||
"Pack",
|
||||
"PackLocalized",
|
||||
"Song",
|
||||
"SongLocalized",
|
||||
"Chart",
|
||||
"ChartLocalized",
|
||||
"ChartInfo",
|
||||
]
|
||||
|
||||
|
||||
class SongsBase(DeclarativeBase):
|
||||
pass
|
||||
|
||||
|
||||
class Property(SongsBase):
|
||||
__tablename__ = "property"
|
||||
|
||||
id: Mapped[str] = mapped_column(TEXT(), primary_key=True)
|
||||
value: Mapped[str] = mapped_column(TEXT())
|
||||
|
||||
|
||||
class Pack(SongsBase):
|
||||
__tablename__ = "pack"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user