-
Notifications
You must be signed in to change notification settings - Fork 288
Remove ON DELETE CASCADE #623
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
base: master
Are you sure you want to change the base?
Conversation
10e3a71
to
8950237
Compare
fix checkstyle fix checkstyle see if the test error is due to schema change check tests check tests checkstyle test test test test test test test test hopefully last test checkstyle already exists checkstyle test move test fix moved test fix test final
|
||
Assertions.assertThrows(DataIntegrityViolationException.class, () -> | ||
polarisConnector.deleteDatabase(dbName)); | ||
Assert.assertTrue(polarisConnector.databaseExists(dbName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Could you also add a check to make sure the table exist as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
throw new InvalidMetaException(name, exception); | ||
} catch (Exception exception) { | ||
throw new ConnectorException( | ||
String.format("Failed deleting polaris database %s", name), exception); | ||
} | ||
System.out.println("DID NOT CATCH THE DB DELETE ERROR"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we get rid of this?
@@ -25,5 +25,5 @@ create table TBLS ( | |||
created_date TIMESTAMP not null, | |||
last_updated_by STRING(255), | |||
last_updated_date TIMESTAMP not null, | |||
foreign key (db_name) references DBS(name) ON DELETE CASCADE ON UPDATE CASCADE | |||
foreign key (db_name) references DBS(name) ON DELETE RESTRICT ON UPDATE CASCADE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want cascading updates? dbname
-> dbname2
would also be bad. Less bad, but still bad.
public DatabasePreconditionFailedException(final QualifiedName name, | ||
@Nullable final String message, | ||
@Nullable final Throwable error) { | ||
super(String.format("Precondition failed to update table %s. %s", name, message), error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this should be update database
?
/** | ||
* Test database deletion if table exists and ON DELETE CASCADE is disabled. | ||
*/ | ||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a test at the PolarisConnectorDatabaseService level as well.
No description provided.