Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion create_test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create_test_instance():
configs = list(CLIENT.list_instance_configs())
if not USE_EMULATOR:
# Filter out non "us" locations
configs = [config for config in configs if "-us-" in config.name]
configs = [config for config in configs if "europe-north1" in config.name]

instance_config = configs[0].name
create_time = str(int(time.time()))
Expand Down
7 changes: 6 additions & 1 deletion google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,12 @@ def get_unique_constraints(self, connection, table_name, schema=None, **kw):
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS ccu
ON ccu.CONSTRAINT_NAME = tc.CONSTRAINT_NAME
WHERE tc.TABLE_NAME="{table_name}" AND tc.CONSTRAINT_TYPE = "UNIQUE"
LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS rc
on tc.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
WHERE
tc.TABLE_NAME="{table_name}"
AND tc.CONSTRAINT_TYPE = "UNIQUE"
AND rc.CONSTRAINT_NAME IS NOT NULL
""".format(
table_name=table_name
)
Expand Down