Skip to content

Commit

Permalink
fix 5.0.4 CI failure (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
mShan0 authored Apr 25, 2024
1 parent 99e83fd commit c1f1dc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mssql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,10 @@ def _column_generated_sql(self, field):
"""Return the SQL to use in a GENERATED ALWAYS clause."""
expression_sql, params = field.generated_sql(self.connection)
persistency_sql = "PERSISTED" if field.db_persist else ""
if params:
if self.connection.features.requires_literal_defaults:
expression_sql = expression_sql % tuple(self.quote_value(p) for p in params)
return f"AS {expression_sql} {persistency_sql}"
params = ()
return f"GENERATED ALWAYS AS ({expression_sql}) {persistency_sql}", params

def _alter_field(self, model, old_field, new_field, old_type, new_type,
old_db_params, new_db_params, strict=False):
Expand Down

0 comments on commit c1f1dc7

Please sign in to comment.