mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
Use enum name instead of value as SQL server_default
SQLAlchemy uses the Enum names in the database, as the values could be generic python objects. https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqlalchemy.types.Enum
This commit is contained in:
parent
8acbf714f7
commit
0e2534fb12
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ from ihatemoney.models import BillType
|
|||
|
||||
|
||||
def upgrade():
|
||||
op.add_column("bill", sa.Column("bill_type", sa.Enum(BillType), server_default=BillType.EXPENSE.value))
|
||||
op.add_column("bill", sa.Column("bill_type", sa.Enum(BillType), server_default=BillType.EXPENSE.name))
|
||||
op.add_column("bill_version", sa.Column("bill_type", sa.UnicodeText()))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue