Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 0cb2dcc

Browse files
committed
Add existing_nullable usage to visit_column_type
Without this, altering operations (e.g. change column length) can cause nullability change of the column. It then causes error if this column is a part of index: "400 Changing NOT NULL constraints on column column_name is not allowed because it affects index index_name"
1 parent a69516d commit 0cb2dcc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,4 +1425,5 @@ def visit_column_type(
14251425
alter_table(compiler, element.table_name, element.schema),
14261426
alter_column(compiler, element.column_name),
14271427
"%s" % format_type(compiler, element.type_),
1428+
"" if element.existing_nullable else "NOT NULL",
14281429
)

0 commit comments

Comments
 (0)