Skip to content

Commit

Permalink
fix: default of sa.column.nullable is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-rus committed Aug 29, 2024
1 parent c3f8482 commit 9a33a99
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mindsdb_sql/render/sqlalchemy_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,18 @@ def prepare_create_table(self, ast_query):
col.is_primary_key = True
col.type = 'INT'

kwargs = {
'primary_key': col.is_primary_key,
'server_default': default,
}
if col.nullable is not None:
kwargs['nullable'] = col.nullable

columns.append(
sa.Column(
col.name,
self.get_type(col.type),
primary_key=col.is_primary_key,
server_default=default,
nullable=col.nullable
**kwargs
)
)

Expand Down

0 comments on commit 9a33a99

Please sign in to comment.