Skip to content

Commit

Permalink
Set server_default in the model definition
Browse files Browse the repository at this point in the history
This makes sure the default value is set when inserting new rows with or without using Sqlalchemy.

Co-authored-by: Nicola Soranzo <[email protected]>
  • Loading branch information
davelopez and nsoranzo committed Apr 27, 2023
1 parent 5066f23 commit 65984d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10140,7 +10140,7 @@ class APIKeys(Base, RepresentById):
user_id = Column(Integer, ForeignKey("galaxy_user.id"), index=True)
key = Column(TrimmedString(32), index=True, unique=True)
user = relationship("User", back_populates="api_keys")
deleted = Column(Boolean, index=True, default=False, nullable=False)
deleted = Column(Boolean, index=True, server_default=false(), nullable=False)


def copy_list(lst, *args, **kwds):
Expand Down

0 comments on commit 65984d7

Please sign in to comment.