Skip to content

Commit 342cc1a

Browse files
authored
Make migration version 24aa37164e72 apply immediately (#17411)
* Fixup migration version 24aa37164e72 * don't instigate a migration
1 parent a8a9391 commit 342cc1a

File tree

2 files changed

+10
-42
lines changed

2 files changed

+10
-42
lines changed

warehouse/migrations/versions/24aa37164e72_update_dynamicfieldsenum_to_include_all_.py

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,14 @@
2525

2626

2727
def upgrade():
28-
op.sync_enum_values(
29-
enum_schema="public",
30-
enum_name="release_dynamic_fields",
31-
new_values=[
32-
"Platform",
33-
"Supported-Platform",
34-
"Summary",
35-
"Description",
36-
"Description-Content-Type",
37-
"Keywords",
38-
"Author",
39-
"Author-Email",
40-
"Maintainer",
41-
"Maintainer-Email",
42-
"License",
43-
"License-Expression",
44-
"License-File",
45-
"Classifier",
46-
"Requires-Dist",
47-
"Requires-Python",
48-
"Requires-External",
49-
"Project-Url",
50-
"Provides-Extra",
51-
"Provides-Dist",
52-
"Obsoletes-Dist",
53-
"Home-Page",
54-
"Download-Url",
55-
"Requires",
56-
"Provides",
57-
"Obsoletes",
58-
],
59-
affected_columns=[
60-
TableReference(
61-
table_schema="public",
62-
table_name="releases",
63-
column_name="dynamic",
64-
column_type=ColumnType.ARRAY,
65-
)
66-
],
67-
enum_values_to_rename=[],
28+
op.execute(
29+
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Requires'"
30+
)
31+
op.execute(
32+
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Provides'"
33+
)
34+
op.execute(
35+
"ALTER TYPE public.release_dynamic_fields ADD VALUE IF NOT EXISTS 'Obsoletes'"
6836
)
6937

7038

warehouse/packaging/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ class ReleaseURL(db.Model):
547547
"Description",
548548
"Description-Content-Type",
549549
"Keywords",
550+
"Home-Page", # Deprecated, but technically permitted by PEP 643
551+
"Download-Url", # Deprecated, but technically permitted by PEP 643
550552
"Author",
551553
"Author-Email",
552554
"Maintainer",
@@ -565,8 +567,6 @@ class ReleaseURL(db.Model):
565567
# Although the following are deprecated fields, they are technically
566568
# permitted as dynamic by PEP 643
567569
# https://github.com/pypa/setuptools/issues/4797#issuecomment-2589514950
568-
"Home-Page",
569-
"Download-Url",
570570
"Requires",
571571
"Provides",
572572
"Obsoletes",

0 commit comments

Comments
 (0)