We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
warehouse/migrations: add missing migrations for organizations
Was crufting up another migration.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `warehouse/organizations/models.py`
Content:
```
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
12 
13 import enum
14 
15 from sqlalchemy import (
16     Boolean,
17     CheckConstraint,
18     Column,
19     DateTime,
20     Enum,
21     ForeignKey,
22     Index,
23     Text,
24     UniqueConstraint,
25     func,
26     orm,
27     sql,
28 )
29 
30 # from sqlalchemy.orm.exc import NoResultFound
31 from sqlalchemy_utils.types.url import URLType
32 
33 from warehouse import db
34 from warehouse.accounts.models import User
35 from warehouse.events.models import HasEvents
36 from warehouse.utils.attrs import make_repr
37 
38 
39 class OrganizationRoleType(enum.Enum):
40 
41     BillingManager = "Billing Manager"
42     Manager = "Manager"
43     Member = "Member"
44     Owner = "Owner"
45 
46 
47 class OrganizationRole(db.Model):
48 
49     __tablename__ = "organization_roles"
50     __table_args__ = (
51         Index("organization_roles_user_id_idx", "user_id"),
52         Index("organization_roles_organization_id_idx", "organization_id"),
53         UniqueConstraint(
54             "user_id",
55             "organization_id",
56             name="_organization_roles_user_organization_uc",
57         ),
58     )
59 
60     __repr__ = make_repr("role_name")
61 
62     role_name = Column(
63         Enum(OrganizationRoleType, values_callable=lambda x: [e.value for e in x]),
64         nullable=False,
65     )
66     user_id = Column(
67         ForeignKey("users.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False
68     )
69     organization_id = Column(
70         ForeignKey("organizations.id", onupdate="CASCADE", ondelete="CASCADE"),
71         nullable=False,
72     )
73 
74     user = orm.relationship(User, lazy=False)
75     organization = orm.relationship("Organization", lazy=False)
76 
77 
78 class OrganizationProject(db.Model):
79 
80     __tablename__ = "organization_project"
81     __table_args__ = (
82         Index("organization_project_organization_id_idx", "organization_id"),
83         Index("organization_project_project_id_idx", "project_id"),
84         UniqueConstraint(
85             "organization_id",
86             "project_id",
87             name="_organization_project_organization_project_uc",
88         ),
89     )
90 
91     __repr__ = make_repr("project_id", "organization_id", "is_active")
92 
93     is_active = Column(Boolean, nullable=False, default=False)
94     organization_id = Column(
95         ForeignKey("organizations.id", onupdate="CASCADE", ondelete="CASCADE"),
96         nullable=False,
97     )
98     project_id = Column(
99         ForeignKey("projects.id", onupdate="CASCADE", ondelete="CASCADE"),
100         nullable=False,
101     )
102 
103     organization = orm.relationship("Organization", lazy=False)
104     project = orm.relationship("Project", lazy=False)
105 
106 
107 class OrganizationType(enum.Enum):
108 
109     Community = "Community"
110     Company = "Company"
111 
112 
113 # TODO: For future use
114 # class OrganizationFactory:
115 #     def __init__(self, request):
116 #         self.request = request
117 #
118 #     def __getitem__(self, organization):
119 #         try:
120 #             return (
121 #                 self.request.db.query(Organization)
122 #                 .filter(
123 #                     Organization.normalized_name
124 #                     == func.normalize_pep426_name(organization)
125 #                 )
126 #                 .one()
127 #             )
128 #         except NoResultFound:
129 #             raise KeyError from None
130 
131 
132 # TODO: Determine if this should also utilize SitemapMixin and TwoFactorRequireable
133 # class Organization(SitemapMixin, TwoFactorRequireable, HasEvents, db.Model):
134 class Organization(HasEvents, db.Model):
135     __tablename__ = "organizations"
136     __table_args__ = (
137         CheckConstraint(
138             "name ~* '^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$'::text",
139             name="organizations_valid_name",
140         ),
141     )
142 
143     __repr__ = make_repr("name")
144 
145     name = Column(Text, nullable=False)
146     normalized_name = orm.column_property(func.normalize_pep426_name(name))
147     display_name = Column(Text, nullable=False)
148     orgtype = Column(
149         Enum(OrganizationType, values_callable=lambda x: [e.value for e in x]),
150         nullable=False,
151     )
152     link_url = Column(URLType, nullable=False)
153     description = Column(Text, nullable=False)
154     is_active = Column(Boolean, nullable=False, default=False)
155     is_approved = Column(Boolean)
156     created = Column(
157         DateTime(timezone=False),
158         nullable=False,
159         server_default=sql.func.now(),
160         index=True,
161     )
162     date_approved = Column(
163         DateTime(timezone=False),
164         nullable=True,
165         onupdate=func.now(),
166     )
167 
168     # TODO: Determine if cascade applies to any of these relationships
169     users = orm.relationship(
170         User, secondary=OrganizationRole.__table__, backref="organizations"  # type: ignore # noqa
171     )
172     projects = orm.relationship(
173         "Project", secondary=OrganizationProject.__table__, backref="organizations"  # type: ignore # noqa
174     )
175 
176     # TODO:
177     #    def __acl__(self):
178 
179 
180 class OrganizationNameCatalog(db.Model):
181 
182     __tablename__ = "organization_name_catalog"
183     __table_args__ = (
184         Index("organization_name_catalog_normalized_name_idx", "normalized_name"),
185         Index("organization_name_catalog_organization_id_idx", "organization_id"),
186         UniqueConstraint(
187             "normalized_name",
188             "organization_id",
189             name="_organization_name_catalog_normalized_name_organization_uc",
190         ),
191     )
192 
193     __repr__ = make_repr("normalized_name", "organization_id")
194 
195     normalized_name = Column(Text, nullable=False)
196     organization_id = Column(
197         ForeignKey("organizations.id", onupdate="CASCADE", ondelete="CASCADE"),
198         nullable=False,
199     )
200 
201 
202 class OrganizationInvitationStatus(enum.Enum):
203 
204     Pending = "pending"
205     Expired = "expired"
206 
207 
208 class OrganizationInvitation(db.Model):
209 
210     __tablename__ = "organization_invitations"
211     __table_args__ = (
212         Index("organization_invitations_user_id_idx", "user_id"),
213         UniqueConstraint(
214             "user_id",
215             "organization_id",
216             name="_organization_invitations_user_organization_uc",
217         ),
218     )
219 
220     __repr__ = make_repr("invite_status", "user", "organization")
221 
222     invite_status = Column(
223         Enum(
224             OrganizationInvitationStatus, values_callable=lambda x: [e.value for e in x]
225         ),
226         nullable=False,
227     )
228     token = Column(Text, nullable=False)
229     user_id = Column(
230         ForeignKey("users.id", onupdate="CASCADE", ondelete="CASCADE"),
231         nullable=False,
232         index=True,
233     )
234     organization_id = Column(
235         ForeignKey("organizations.id", onupdate="CASCADE", ondelete="CASCADE"),
236         nullable=False,
237         index=True,
238     )
239 
240     user = orm.relationship(User, lazy=False)
241     organization = orm.relationship("Organization", lazy=False)
242
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/warehouse/organizations/models.py b/warehouse/organizations/models.py
--- a/warehouse/organizations/models.py
+++ b/warehouse/organizations/models.py
@@ -90,7 +90,7 @@
 
     __repr__ = make_repr("project_id", "organization_id", "is_active")
 
-    is_active = Column(Boolean, nullable=False, default=False)
+    is_active = Column(Boolean, nullable=False, server_default=sql.false())
     organization_id = Column(
         ForeignKey("organizations.id", onupdate="CASCADE", ondelete="CASCADE"),
         nullable=False,
@@ -151,7 +151,7 @@
     )
     link_url = Column(URLType, nullable=False)
     description = Column(Text, nullable=False)
-    is_active = Column(Boolean, nullable=False, default=False)
+    is_active = Column(Boolean, nullable=False, server_default=sql.false())
     is_approved = Column(Boolean)
     created = Column(
         DateTime(timezone=False),

{"golden_diff": "diff --git a/warehouse/organizations/models.py b/warehouse/organizations/models.py\n--- a/warehouse/organizations/models.py\n+++ b/warehouse/organizations/models.py\n@@ -90,7 +90,7 @@\n \n     __repr__ = make_repr(\"project_id\", \"organization_id\", \"is_active\")\n \n-    is_active = Column(Boolean, nullable=False, default=False)\n+    is_active = Column(Boolean, nullable=False, server_default=sql.false())\n     organization_id = Column(\n         ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n         nullable=False,\n@@ -151,7 +151,7 @@\n     )\n     link_url = Column(URLType, nullable=False)\n     description = Column(Text, nullable=False)\n-    is_active = Column(Boolean, nullable=False, default=False)\n+    is_active = Column(Boolean, nullable=False, server_default=sql.false())\n     is_approved = Column(Boolean)\n     created = Column(\n         DateTime(timezone=False),\n", "issue": "warehouse/migrations: add missing migrations for organizations\nWas crufting up another migration.\n", "before_files": [{"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport enum\n\nfrom sqlalchemy import (\n    Boolean,\n    CheckConstraint,\n    Column,\n    DateTime,\n    Enum,\n    ForeignKey,\n    Index,\n    Text,\n    UniqueConstraint,\n    func,\n    orm,\n    sql,\n)\n\n# from sqlalchemy.orm.exc import NoResultFound\nfrom sqlalchemy_utils.types.url import URLType\n\nfrom warehouse import db\nfrom warehouse.accounts.models import User\nfrom warehouse.events.models import HasEvents\nfrom warehouse.utils.attrs import make_repr\n\n\nclass OrganizationRoleType(enum.Enum):\n\n    BillingManager = \"Billing Manager\"\n    Manager = \"Manager\"\n    Member = \"Member\"\n    Owner = \"Owner\"\n\n\nclass OrganizationRole(db.Model):\n\n    __tablename__ = \"organization_roles\"\n    __table_args__ = (\n        Index(\"organization_roles_user_id_idx\", \"user_id\"),\n        Index(\"organization_roles_organization_id_idx\", \"organization_id\"),\n        UniqueConstraint(\n            \"user_id\",\n            \"organization_id\",\n            name=\"_organization_roles_user_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"role_name\")\n\n    role_name = Column(\n        Enum(OrganizationRoleType, values_callable=lambda x: [e.value for e in x]),\n        nullable=False,\n    )\n    user_id = Column(\n        ForeignKey(\"users.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"), nullable=False\n    )\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n    user = orm.relationship(User, lazy=False)\n    organization = orm.relationship(\"Organization\", lazy=False)\n\n\nclass OrganizationProject(db.Model):\n\n    __tablename__ = \"organization_project\"\n    __table_args__ = (\n        Index(\"organization_project_organization_id_idx\", \"organization_id\"),\n        Index(\"organization_project_project_id_idx\", \"project_id\"),\n        UniqueConstraint(\n            \"organization_id\",\n            \"project_id\",\n            name=\"_organization_project_organization_project_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"project_id\", \"organization_id\", \"is_active\")\n\n    is_active = Column(Boolean, nullable=False, default=False)\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n    project_id = Column(\n        ForeignKey(\"projects.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n    organization = orm.relationship(\"Organization\", lazy=False)\n    project = orm.relationship(\"Project\", lazy=False)\n\n\nclass OrganizationType(enum.Enum):\n\n    Community = \"Community\"\n    Company = \"Company\"\n\n\n# TODO: For future use\n# class OrganizationFactory:\n#     def __init__(self, request):\n#         self.request = request\n#\n#     def __getitem__(self, organization):\n#         try:\n#             return (\n#                 self.request.db.query(Organization)\n#                 .filter(\n#                     Organization.normalized_name\n#                     == func.normalize_pep426_name(organization)\n#                 )\n#                 .one()\n#             )\n#         except NoResultFound:\n#             raise KeyError from None\n\n\n# TODO: Determine if this should also utilize SitemapMixin and TwoFactorRequireable\n# class Organization(SitemapMixin, TwoFactorRequireable, HasEvents, db.Model):\nclass Organization(HasEvents, db.Model):\n    __tablename__ = \"organizations\"\n    __table_args__ = (\n        CheckConstraint(\n            \"name ~* '^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$'::text\",\n            name=\"organizations_valid_name\",\n        ),\n    )\n\n    __repr__ = make_repr(\"name\")\n\n    name = Column(Text, nullable=False)\n    normalized_name = orm.column_property(func.normalize_pep426_name(name))\n    display_name = Column(Text, nullable=False)\n    orgtype = Column(\n        Enum(OrganizationType, values_callable=lambda x: [e.value for e in x]),\n        nullable=False,\n    )\n    link_url = Column(URLType, nullable=False)\n    description = Column(Text, nullable=False)\n    is_active = Column(Boolean, nullable=False, default=False)\n    is_approved = Column(Boolean)\n    created = Column(\n        DateTime(timezone=False),\n        nullable=False,\n        server_default=sql.func.now(),\n        index=True,\n    )\n    date_approved = Column(\n        DateTime(timezone=False),\n        nullable=True,\n        onupdate=func.now(),\n    )\n\n    # TODO: Determine if cascade applies to any of these relationships\n    users = orm.relationship(\n        User, secondary=OrganizationRole.__table__, backref=\"organizations\"  # type: ignore # noqa\n    )\n    projects = orm.relationship(\n        \"Project\", secondary=OrganizationProject.__table__, backref=\"organizations\"  # type: ignore # noqa\n    )\n\n    # TODO:\n    #    def __acl__(self):\n\n\nclass OrganizationNameCatalog(db.Model):\n\n    __tablename__ = \"organization_name_catalog\"\n    __table_args__ = (\n        Index(\"organization_name_catalog_normalized_name_idx\", \"normalized_name\"),\n        Index(\"organization_name_catalog_organization_id_idx\", \"organization_id\"),\n        UniqueConstraint(\n            \"normalized_name\",\n            \"organization_id\",\n            name=\"_organization_name_catalog_normalized_name_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"normalized_name\", \"organization_id\")\n\n    normalized_name = Column(Text, nullable=False)\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n\nclass OrganizationInvitationStatus(enum.Enum):\n\n    Pending = \"pending\"\n    Expired = \"expired\"\n\n\nclass OrganizationInvitation(db.Model):\n\n    __tablename__ = \"organization_invitations\"\n    __table_args__ = (\n        Index(\"organization_invitations_user_id_idx\", \"user_id\"),\n        UniqueConstraint(\n            \"user_id\",\n            \"organization_id\",\n            name=\"_organization_invitations_user_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"invite_status\", \"user\", \"organization\")\n\n    invite_status = Column(\n        Enum(\n            OrganizationInvitationStatus, values_callable=lambda x: [e.value for e in x]\n        ),\n        nullable=False,\n    )\n    token = Column(Text, nullable=False)\n    user_id = Column(\n        ForeignKey(\"users.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n        index=True,\n    )\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n        index=True,\n    )\n\n    user = orm.relationship(User, lazy=False)\n    organization = orm.relationship(\"Organization\", lazy=False)\n", "path": "warehouse/organizations/models.py"}], "after_files": [{"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport enum\n\nfrom sqlalchemy import (\n    Boolean,\n    CheckConstraint,\n    Column,\n    DateTime,\n    Enum,\n    ForeignKey,\n    Index,\n    Text,\n    UniqueConstraint,\n    func,\n    orm,\n    sql,\n)\n\n# from sqlalchemy.orm.exc import NoResultFound\nfrom sqlalchemy_utils.types.url import URLType\n\nfrom warehouse import db\nfrom warehouse.accounts.models import User\nfrom warehouse.events.models import HasEvents\nfrom warehouse.utils.attrs import make_repr\n\n\nclass OrganizationRoleType(enum.Enum):\n\n    BillingManager = \"Billing Manager\"\n    Manager = \"Manager\"\n    Member = \"Member\"\n    Owner = \"Owner\"\n\n\nclass OrganizationRole(db.Model):\n\n    __tablename__ = \"organization_roles\"\n    __table_args__ = (\n        Index(\"organization_roles_user_id_idx\", \"user_id\"),\n        Index(\"organization_roles_organization_id_idx\", \"organization_id\"),\n        UniqueConstraint(\n            \"user_id\",\n            \"organization_id\",\n            name=\"_organization_roles_user_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"role_name\")\n\n    role_name = Column(\n        Enum(OrganizationRoleType, values_callable=lambda x: [e.value for e in x]),\n        nullable=False,\n    )\n    user_id = Column(\n        ForeignKey(\"users.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"), nullable=False\n    )\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n    user = orm.relationship(User, lazy=False)\n    organization = orm.relationship(\"Organization\", lazy=False)\n\n\nclass OrganizationProject(db.Model):\n\n    __tablename__ = \"organization_project\"\n    __table_args__ = (\n        Index(\"organization_project_organization_id_idx\", \"organization_id\"),\n        Index(\"organization_project_project_id_idx\", \"project_id\"),\n        UniqueConstraint(\n            \"organization_id\",\n            \"project_id\",\n            name=\"_organization_project_organization_project_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"project_id\", \"organization_id\", \"is_active\")\n\n    is_active = Column(Boolean, nullable=False, server_default=sql.false())\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n    project_id = Column(\n        ForeignKey(\"projects.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n    organization = orm.relationship(\"Organization\", lazy=False)\n    project = orm.relationship(\"Project\", lazy=False)\n\n\nclass OrganizationType(enum.Enum):\n\n    Community = \"Community\"\n    Company = \"Company\"\n\n\n# TODO: For future use\n# class OrganizationFactory:\n#     def __init__(self, request):\n#         self.request = request\n#\n#     def __getitem__(self, organization):\n#         try:\n#             return (\n#                 self.request.db.query(Organization)\n#                 .filter(\n#                     Organization.normalized_name\n#                     == func.normalize_pep426_name(organization)\n#                 )\n#                 .one()\n#             )\n#         except NoResultFound:\n#             raise KeyError from None\n\n\n# TODO: Determine if this should also utilize SitemapMixin and TwoFactorRequireable\n# class Organization(SitemapMixin, TwoFactorRequireable, HasEvents, db.Model):\nclass Organization(HasEvents, db.Model):\n    __tablename__ = \"organizations\"\n    __table_args__ = (\n        CheckConstraint(\n            \"name ~* '^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$'::text\",\n            name=\"organizations_valid_name\",\n        ),\n    )\n\n    __repr__ = make_repr(\"name\")\n\n    name = Column(Text, nullable=False)\n    normalized_name = orm.column_property(func.normalize_pep426_name(name))\n    display_name = Column(Text, nullable=False)\n    orgtype = Column(\n        Enum(OrganizationType, values_callable=lambda x: [e.value for e in x]),\n        nullable=False,\n    )\n    link_url = Column(URLType, nullable=False)\n    description = Column(Text, nullable=False)\n    is_active = Column(Boolean, nullable=False, server_default=sql.false())\n    is_approved = Column(Boolean)\n    created = Column(\n        DateTime(timezone=False),\n        nullable=False,\n        server_default=sql.func.now(),\n        index=True,\n    )\n    date_approved = Column(\n        DateTime(timezone=False),\n        nullable=True,\n        onupdate=func.now(),\n    )\n\n    # TODO: Determine if cascade applies to any of these relationships\n    users = orm.relationship(\n        User, secondary=OrganizationRole.__table__, backref=\"organizations\"  # type: ignore # noqa\n    )\n    projects = orm.relationship(\n        \"Project\", secondary=OrganizationProject.__table__, backref=\"organizations\"  # type: ignore # noqa\n    )\n\n    # TODO:\n    #    def __acl__(self):\n\n\nclass OrganizationNameCatalog(db.Model):\n\n    __tablename__ = \"organization_name_catalog\"\n    __table_args__ = (\n        Index(\"organization_name_catalog_normalized_name_idx\", \"normalized_name\"),\n        Index(\"organization_name_catalog_organization_id_idx\", \"organization_id\"),\n        UniqueConstraint(\n            \"normalized_name\",\n            \"organization_id\",\n            name=\"_organization_name_catalog_normalized_name_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"normalized_name\", \"organization_id\")\n\n    normalized_name = Column(Text, nullable=False)\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n    )\n\n\nclass OrganizationInvitationStatus(enum.Enum):\n\n    Pending = \"pending\"\n    Expired = \"expired\"\n\n\nclass OrganizationInvitation(db.Model):\n\n    __tablename__ = \"organization_invitations\"\n    __table_args__ = (\n        Index(\"organization_invitations_user_id_idx\", \"user_id\"),\n        UniqueConstraint(\n            \"user_id\",\n            \"organization_id\",\n            name=\"_organization_invitations_user_organization_uc\",\n        ),\n    )\n\n    __repr__ = make_repr(\"invite_status\", \"user\", \"organization\")\n\n    invite_status = Column(\n        Enum(\n            OrganizationInvitationStatus, values_callable=lambda x: [e.value for e in x]\n        ),\n        nullable=False,\n    )\n    token = Column(Text, nullable=False)\n    user_id = Column(\n        ForeignKey(\"users.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n        index=True,\n    )\n    organization_id = Column(\n        ForeignKey(\"organizations.id\", onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n        nullable=False,\n        index=True,\n    )\n\n    user = orm.relationship(User, lazy=False)\n    organization = orm.relationship(\"Organization\", lazy=False)\n", "path": "warehouse/organizations/models.py"}]}