Skip to content

Commit d3f1d20

Browse files
committed
Set name of mod_followers primary key from migration
1 parent 746c7e0 commit d3f1d20

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

KerbalStuff/objects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class Following(Base): # type: ignore
1818
__tablename__ = 'mod_followers'
19-
__table_args__ = (PrimaryKeyConstraint('user_id', 'mod_id'), )
19+
__table_args__ = (PrimaryKeyConstraint('user_id', 'mod_id', name='pk_mod_followers'), )
2020
mod_id = Column(Integer, ForeignKey('mod.id'), index=True)
2121
mod = relationship('Mod', back_populates='followings')
2222
user_id = Column(Integer, ForeignKey('user.id'), index=True)

alembic/versions/2021_06_28_19_00_00-17fbd4ff8193.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Mod(Base): # type: ignore
2828

2929
class Following(Base): # type: ignore
3030
__tablename__ = 'mod_followers'
31-
__table_args__ = (sa.PrimaryKeyConstraint('user_id', 'mod_id'), )
31+
__table_args__ = (sa.PrimaryKeyConstraint('user_id', 'mod_id', name='pk_mod_followers'), )
3232
mod_id = sa.Column(sa.Integer, sa.ForeignKey('mod.id'))
3333
user_id = sa.Column(sa.Integer, sa.ForeignKey('user.id'))
3434
send_update = sa.Column(sa.Boolean(), default=True)

0 commit comments

Comments
 (0)