Skip to content

Commit 195c71b

Browse files
committed
Change also submission.length
1 parent af664f1 commit 195c71b

3 files changed

+69
-1
lines changed

acoustid/tables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
Column("source_id", Integer, nullable=True), # XXX deprecated
160160
# fingerprint
161161
Column("fingerprint", ARRAY(Integer), nullable=False),
162-
Column("length", SmallInteger, CheckConstraint("length>0"), nullable=False),
162+
Column("length", Integer, CheckConstraint("length>0"), nullable=False),
163163
Column("bitrate", SmallInteger, CheckConstraint("bitrate>0")),
164164
Column("format", String),
165165
Column("format_id", Integer), # XXX deprecated

alembic/versions/468b44482655_change_fingerprint_length_to_int4.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ def downgrade_app():
3838

3939
def upgrade_ingest():
4040
# ### commands auto generated by Alembic - please adjust! ###
41+
pass
4142
# ### end Alembic commands ###
4243

4344

4445
def downgrade_ingest():
4546
# ### commands auto generated by Alembic - please adjust! ###
47+
pass
4648
# ### end Alembic commands ###
4749

4850

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
"""change submission length to int4
2+
3+
Revision ID: d7e8b1c80561
4+
Revises: 468b44482655
5+
Create Date: 2025-03-08 20:51:37.654499
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
from sqlalchemy.dialects import postgresql
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'd7e8b1c80561'
14+
down_revision = '468b44482655'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade(engine_name):
20+
globals()["upgrade_%s" % engine_name]()
21+
22+
23+
def downgrade(engine_name):
24+
globals()["downgrade_%s" % engine_name]()
25+
26+
27+
def upgrade_app():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
pass
30+
# ### end Alembic commands ###
31+
32+
33+
def downgrade_app():
34+
# ### commands auto generated by Alembic - please adjust! ###
35+
pass
36+
# ### end Alembic commands ###
37+
38+
39+
def upgrade_ingest():
40+
# ### commands auto generated by Alembic - please adjust! ###
41+
op.alter_column('submission', 'length',
42+
existing_type=sa.SMALLINT(),
43+
type_=sa.Integer(),
44+
existing_nullable=False)
45+
# ### end Alembic commands ###
46+
47+
48+
def downgrade_ingest():
49+
# ### commands auto generated by Alembic - please adjust! ###
50+
op.alter_column('submission', 'length',
51+
existing_type=sa.Integer(),
52+
type_=sa.SMALLINT(),
53+
existing_nullable=False)
54+
# ### end Alembic commands ###
55+
56+
57+
def upgrade_fingerprint():
58+
# ### commands auto generated by Alembic - please adjust! ###
59+
pass
60+
# ### end Alembic commands ###
61+
62+
63+
def downgrade_fingerprint():
64+
# ### commands auto generated by Alembic - please adjust! ###
65+
pass
66+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)