-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreign key referential action ON DELETE NO ACTION is not supported #142
Comments
Hey Graeme, |
Hi Manu! I can also reproduce the issue with wrench |
I figured out that wrench has started adding
But my migration script doesn't actually contain
|
Got it. So if I correctly understand the issue, it looks like for a foreign key constraint without any action, wrench is automatically adding a "ON DELETE NO ACTION", even though you don't have it in your original schema. |
Yup you've understood it correctly. Okay I'll create an issue for wrench and close this ticket. I wasn't sure whether it was wrench or the emulator that needed to change. Let's see if wrench can fix it so they don't modify the migration. |
FYI: Using emulator version |
Summary
It seems the emulator doesn't support the
ON DELETE NO ACTION
syntax when creating a table with a foreign key constraint.I can work-around this by removing
ON DELETE NO ACTION
from my create statement, and the table is successfully created.Unfortunately spanner's migration tool wrench is modifying my migration scripts by automatically adding
ON DELETE NO ACTION
, meaning I cannot apply my migration scripts using wrench and the spanner emulator.I have existing migration scripts that I've applied in production and they used to work with the spanner emulator. But now they are failing with the latest versions of wrench and cloud-spanner-emulator. My assumption is that wrench is behaving properly by automaticaly adding
ON DELETE NO ACTION
, since that is the default behaviour anyways, so I'm posting here instead of in the wrench github repo.Steps to reproduce
Create Table1
Try to create Table2
Get error:
Successfully create Table2 without ON DELETE:
The text was updated successfully, but these errors were encountered: