-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/ddl extension support #223
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
Open
Femi3211
wants to merge
6
commits into
develop
Choose a base branch
from
feature/ddl-extension-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5720979
added: initial groundwork for extension support (target 3.0)
ailegion d4231e9
Merge branch 'refs/heads/develop' into feature/ddl-extension-support
Femi3211 0a69e6b
modified: extension for SQL migration level for rosetta, pointing to …
Femi3211 bb72507
Merge branch 'refs/heads/develop' into feature/ddl-extension-support
Femi3211 0fcef00
Merge branch 'refs/heads/develop' into feature/ddl-extension-support
Femi3211 830e835
added: documentation for Rosetta extension support
Femi3211 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
36 changes: 36 additions & 0 deletions
36
common/src/main/java/com/adaptivescale/rosetta/common/models/Extension.java
This file contains hidden or 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,36 @@ | ||
| package com.adaptivescale.rosetta.common.models; | ||
|
|
||
|
|
||
| import com.adaptivescale.rosetta.common.models.enums.ExtensionTypesEnum; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public class Extension { | ||
| private String name; | ||
| private ExtensionTypesEnum type; | ||
| private Map<String,Object> actions; | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public ExtensionTypesEnum getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public void setType(ExtensionTypesEnum type) { | ||
| this.type = type; | ||
| } | ||
|
|
||
| public Map<String, Object> getActions() { | ||
| return actions; | ||
| } | ||
|
|
||
| public void setActions(Map<String, Object> actions) { | ||
| this.actions = actions; | ||
| } | ||
| } |
This file contains hidden or 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
5 changes: 5 additions & 0 deletions
5
common/src/main/java/com/adaptivescale/rosetta/common/models/enums/ExtensionTypesEnum.java
This file contains hidden or 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,5 @@ | ||
| package com.adaptivescale.rosetta.common.models.enums; | ||
|
|
||
| public enum ExtensionTypesEnum { | ||
| DDL_EXTENSION, | ||
| } |
10 changes: 10 additions & 0 deletions
10
common/src/main/java/com/adaptivescale/rosetta/common/models/enums/OperationTypeEnum.java
This file contains hidden or 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,10 @@ | ||
| package com.adaptivescale.rosetta.common.models.enums; | ||
|
|
||
| public enum OperationTypeEnum { | ||
| PRE_CREATE, | ||
| PRE_ALTER, | ||
| PRE_DROP, | ||
| POST_CREATE, | ||
| POST_ALTER, | ||
| POST_DROP | ||
| } | ||
This file contains hidden or 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
17 changes: 17 additions & 0 deletions
17
ddl/src/main/java/com/adaptivescale/rosetta/ddl/DDLExtensionColumn.java
This file contains hidden or 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,17 @@ | ||
| package com.adaptivescale.rosetta.ddl; | ||
|
|
||
| import com.adaptivescale.rosetta.common.models.Column; | ||
|
|
||
|
|
||
| public interface DDLExtensionColumn { | ||
|
|
||
| String preCreateColumn(Column column, Object action); | ||
| String postCreateColumn(Column column, Object action); | ||
|
|
||
| String preDropColumn(Column column, Object action); | ||
| String postDropColumn(Column column, Object action); | ||
|
|
||
| String preAlterColumn(Column column, Object action); | ||
| String postAlterColumn(Column column, Object action); | ||
|
|
||
| } |
19 changes: 19 additions & 0 deletions
19
ddl/src/main/java/com/adaptivescale/rosetta/ddl/DDLExtensionTable.java
This file contains hidden or 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,19 @@ | ||
| package com.adaptivescale.rosetta.ddl; | ||
|
|
||
| import com.adaptivescale.rosetta.common.models.*; | ||
| import com.adaptivescale.rosetta.ddl.change.model.ColumnChange; | ||
| import com.adaptivescale.rosetta.ddl.change.model.ForeignKeyChange; | ||
|
|
||
|
|
||
| public interface DDLExtensionTable { | ||
|
|
||
| String preCreateTable(Table table, Object action); | ||
| String postCreateTable(Table table, Object action); | ||
|
|
||
| String preDropTable(Table actual, Object action); | ||
| String postDropTable(Table actual, Object action); | ||
|
|
||
| String preAlterTable(Table expected, Object action); | ||
| String postAlterTable(Table expected, Object action); | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Everywhere in YAML we use
camelCase, this part uses all UPPERCASE and _. This part does not make uniform the model.yaml structure.Any opinion on this?
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.
I went through with uppercase because of it being an Enum Class, but i am open to changing if needed