feat: Switch to postgres

Migrate from MariaDB to PostgreSQL.

Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
moson 2023-11-30 15:13:42 +01:00
parent 3220cf886e
commit db8e2458f9
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
64 changed files with 572 additions and 629 deletions

View file

@ -21,6 +21,13 @@ CLOSED_ID = 1
ACCEPTED_ID = 2
REJECTED_ID = 3
STATUS_DISPLAY = {
PENDING_ID: PENDING,
CLOSED_ID: CLOSED,
ACCEPTED_ID: ACCEPTED,
REJECTED_ID: REJECTED,
}
class PackageRequest(Base):
__table__ = schema.PackageRequests
@ -51,13 +58,6 @@ class PackageRequest(Base):
foreign_keys=[__table__.c.ClosedUID],
)
STATUS_DISPLAY = {
PENDING_ID: PENDING,
CLOSED_ID: CLOSED,
ACCEPTED_ID: ACCEPTED,
REJECTED_ID: REJECTED,
}
def __init__(self, **kwargs):
super().__init__(**kwargs)
@ -105,7 +105,7 @@ class PackageRequest(Base):
def status_display(self) -> str:
"""Return a display string for the Status column."""
return self.STATUS_DISPLAY[self.Status]
return STATUS_DISPLAY[self.Status]
def ml_message_id_hash(self) -> str:
"""Return the X-Message-ID-Hash that is used in the mailing list archive."""