From 69984788fa27df966c14ac46f58cde2811895aa1 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 19 Feb 2024 17:22:38 +0300 Subject: [PATCH] no-unique-index --- orm/author.py | 5 +++-- orm/collection.py | 2 +- orm/community.py | 2 +- orm/shout.py | 2 +- orm/topic.py | 2 +- pyproject.toml | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/orm/author.py b/orm/author.py index 84fa3f67..df6b4067 100644 --- a/orm/author.py +++ b/orm/author.py @@ -28,10 +28,11 @@ class AuthorFollower(Base): class Author(Base): __tablename__ = 'author' - user = Column(String, unique=True) # unbounded link with authorizer's User type + user = Column(String, + ) # unbounded link with authorizer's User type name = Column(String, nullable=True, comment='Display name') - slug = Column(String, unique=True, comment="Author's slug", index=True) + slug = Column(String, unique=True, comment="Author's slug") bio = Column(String, nullable=True, comment='Bio') # status description about = Column(String, nullable=True, comment='About') # long and formatted pic = Column(String, nullable=True, comment='Picture') diff --git a/orm/collection.py b/orm/collection.py index c0b8d342..87592bc8 100644 --- a/orm/collection.py +++ b/orm/collection.py @@ -16,7 +16,7 @@ class ShoutCollection(Base): class Collection(Base): __tablename__ = 'collection' - slug = Column(String, unique=True, index=True) + slug = Column(String, unique=True) title = Column(String, nullable=False, comment='Title') body = Column(String, nullable=True, comment='Body') pic = Column(String, nullable=True, comment='Picture') diff --git a/orm/community.py b/orm/community.py index 3c186a0c..ff156bd9 100644 --- a/orm/community.py +++ b/orm/community.py @@ -21,7 +21,7 @@ class Community(Base): __tablename__ = 'community' name = Column(String, nullable=False) - slug = Column(String, nullable=False, unique=True, index=True) + slug = Column(String, nullable=False, unique=True) desc = Column(String, nullable=False, default='') pic = Column(String, nullable=False, default='') created_at = Column(Integer, nullable=False, default=lambda: int(time.time())) diff --git a/orm/shout.py b/orm/shout.py index e5f53d9f..2757bcb6 100644 --- a/orm/shout.py +++ b/orm/shout.py @@ -61,7 +61,7 @@ class Shout(Base): deleted_by = Column(ForeignKey('author.id'), nullable=True) body = Column(String, nullable=False, comment='Body') - slug = Column(String, unique=True, index=True) + slug = Column(String, unique=True) cover = Column(String, nullable=True, comment='Cover image url') cover_caption = Column(String, nullable=True, comment='Cover image alt caption') lead = Column(String, nullable=True) diff --git a/orm/topic.py b/orm/topic.py index 73e0131b..928b0129 100644 --- a/orm/topic.py +++ b/orm/topic.py @@ -18,7 +18,7 @@ class TopicFollower(Base): class Topic(Base): __tablename__ = 'topic' - slug = Column(String, unique=True, index=True) + slug = Column(String, unique=True) title = Column(String, nullable=False, comment='Title') body = Column(String, nullable=True, comment='Body') pic = Column(String, nullable=True, comment='Picture') diff --git a/pyproject.toml b/pyproject.toml index c8c89386..5e706dda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ typings = {} mergeTypeStubPackages = false [tool.pytest.ini_options] -pythonpath = ["tests"] +pythonpath = ["."] [tool.pytest] python_files = "*_test.py"