forked from cloudspannerecosystem/spanner-schema-diff-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ON DELETE clause in table foreign constraint (cloudspannereco…
…system#59) * Support ON DELETE clause in table foreign constraint * Ran mvn spotless:apply
- Loading branch information
1 parent
f7004c9
commit d098c60
Showing
8 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/google/cloud/solutions/spannerddl/parser/ASTon_delete.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.cloud.solutions.spannerddl.parser; | ||
|
||
public class ASTon_delete extends SimpleNode { | ||
public ASTon_delete(int id) { | ||
super(id); | ||
} | ||
|
||
public ASTon_delete(DdlParser p, int id) { | ||
super(p, id); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
if (children[0] instanceof ASTreferential_action) { | ||
return "ON DELETE " + children[0]; | ||
} else { | ||
throw new UnsupportedOperationException("Not Implemented"); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return (other instanceof ASTon_delete && this.toString().equals(other.toString())); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/google/cloud/solutions/spannerddl/parser/ASTreferential_action.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.cloud.solutions.spannerddl.parser; | ||
|
||
import com.google.cloud.solutions.spannerddl.diff.ASTTreeUtils; | ||
|
||
public class ASTreferential_action extends SimpleNode { | ||
public ASTreferential_action(int id) { | ||
super(id); | ||
} | ||
|
||
public ASTreferential_action(DdlParser p, int id) { | ||
super(p, id); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return ASTTreeUtils.tokensToString(this); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return (other instanceof ASTreferential_action && this.toString().equals(other.toString())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters