refactor: 将数据库迁移收成一份当前结构
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, String, Text, UniqueConstraint, false as sql_false, true as sql_true
|
||||
from sqlalchemy import Boolean, DateTime, Index, String, Text, UniqueConstraint, false as sql_false, true as sql_true
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||
|
||||
|
||||
@@ -67,7 +67,10 @@ class Account(Base):
|
||||
|
||||
class ProxyNode(Base):
|
||||
__tablename__ = "proxy_nodes"
|
||||
__table_args__ = (UniqueConstraint("scheme", "host", "port", name="uq_proxy_node_addr"),)
|
||||
__table_args__ = (
|
||||
UniqueConstraint("scheme", "host", "port", name="uq_proxy_node_addr"),
|
||||
Index("ix_proxy_nodes_status", "status"),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
scheme: Mapped[str] = mapped_column(String(16), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user