Skip to content

Commit

Permalink
修复项目联合索引问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Jul 28, 2022
1 parent 314cbb9 commit 9d2b5c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/models/project.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
from sqlalchemy import INT, Column, String, BOOLEAN
from sqlalchemy import INT, Column, String, BOOLEAN, UniqueConstraint

from app.models.basic import PityBase


class Project(PityBase):
__tablename__ = 'pity_project'
name = Column(String(16), unique=True, index=True)
name = Column(String(16))
owner = Column(INT)
app = Column(String(32), index=True)
app = Column(String(32))
private = Column(BOOLEAN, default=False)
description = Column(String(200))
avatar = Column(String(128), nullable=True)
dingtalk_url = Column(String(128), nullable=True)
__table_args__ = (
UniqueConstraint('name', 'deleted_at'),
)
__tag__ = "项目"
__fields__ = (name, owner, app, private, description, avatar, dingtalk_url)
__alias__ = dict(name="项目名称", owner="项目所有者", app="项目所属应用", private="是否私有", description="项目描述", avatar="项目头像",
Expand Down

0 comments on commit 9d2b5c5

Please sign in to comment.