Skip to content

Commit

Permalink
Fix: packages.area converted from varchar(8) to varchar
Browse files Browse the repository at this point in the history
This can accomodate non-free-firmware.

Nowadays there's no good reason to use an upper limit on varchar
length, aside from having Postgres limit possible inputs.
  • Loading branch information
matthieucan committed Apr 16, 2024
1 parent d86200b commit 568fd48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/debsources/migrate/012-to-013.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Remove size constraint on packages.area
-- From varchar(8) to varchar
-- This allows "non-free-firmware"

ALTER TABLE packages ALTER COLUMN area TYPE varchar;
8 changes: 1 addition & 7 deletions lib/debsources/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
Base = declarative_base()


# used for migrations, see scripts under debsources/migrate/
DB_SCHEMA_VERSION = 11


class PackageName(Base):
"""a source package name"""

Expand Down Expand Up @@ -85,7 +81,7 @@ class Package(Base):
index=True,
nullable=False,
)
area = Column(String(8), index=True) # main, contrib, non-free, non-free-firmware
area = Column(String, index=True) # main, contrib, non-free, non-free-firmware
vcs_type = Column(Enum(*VCS_TYPES, name="vcs_types"))
vcs_url = Column(String)
vcs_browser = Column(String)
Expand Down Expand Up @@ -437,7 +433,6 @@ def __init__(self, suite, timestamp):


class FileCopyright(Base):

__tablename__ = "copyright"

id = Column(BIGINT, primary_key=True)
Expand All @@ -458,7 +453,6 @@ def to_dict(self):


class HistoryCopyright(Base):

__tablename__ = "history_copyright"

id = Column(BIGINT, primary_key=True)
Expand Down

0 comments on commit 568fd48

Please sign in to comment.