-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add normalization to destination definition and actor definition table #18300
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
Merged
tuliren
merged 17 commits into
master
from
akorotkov/18230_update_StandardDestinationDefinition
Nov 4, 2022
Merged
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a66c9e3
updated StandardDestinationDefinition.yaml, added normalization and t…
andriikorotkov cd06906
Merge branch 'master' of github.com:airbytehq/airbyte into akorotkov/…
andriikorotkov ff213af
updated docs
andriikorotkov 59d6e50
Merge branch 'master' of github.com:airbytehq/airbyte into akorotkov/…
andriikorotkov facb18a
updated BootloaderAppTest.java for new migration
andriikorotkov e989bb3
updated schema dump
andriikorotkov bccc807
Merge branch 'master' of github.com:airbytehq/airbyte into akorotkov/…
andriikorotkov 753c3a1
Merge branch 'master' into akorotkov/18230_update_StandardDestination…
tuliren cb75eb5
Update normalization version and fix bigquery
tuliren e182466
Use varchar 255
tuliren cb04967
Update migration version to the latest
tuliren 3fdeff5
Update normalized table schema file and add comment
tuliren acbbdb7
Revert "Use varchar 255"
tuliren 6a12b8a
Use varchar 255
tuliren 49fdc92
Merge branch 'master' of github.com:airbytehq/airbyte into akorotkov/…
tuliren e2ff5c4
Add unit test for migration
tuliren 5db1d94
Format code
tuliren 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
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
56 changes: 56 additions & 0 deletions
56
...stance/configs/migrations/V0_40_15_001__AddActorDefinitionNormalizationAndDbtColumns.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,56 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.db.instance.configs.migrations; | ||
|
||
import org.flywaydb.core.api.migration.BaseJavaMigration; | ||
import org.flywaydb.core.api.migration.Context; | ||
import org.jooq.DSLContext; | ||
import org.jooq.impl.DSL; | ||
import org.jooq.impl.SQLDataType; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
// TODO: update migration description in the class name | ||
public class V0_40_15_001__AddActorDefinitionNormalizationAndDbtColumns extends BaseJavaMigration { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(V0_40_15_001__AddActorDefinitionNormalizationAndDbtColumns.class); | ||
|
||
@Override | ||
public void migrate(final Context context) throws Exception { | ||
LOGGER.info("Running migration: {}", this.getClass().getSimpleName()); | ||
|
||
// Warning: please do not use any jOOQ generated code to write a migration. | ||
// As database schema changes, the generated jOOQ code can be deprecated. So | ||
// old migration may not compile if there is any generated code. | ||
final DSLContext ctx = DSL.using(context.getConnection()); | ||
addNormalizationRepositoryColumn(ctx); | ||
addNormalizationTagColumn(ctx); | ||
addSupportsDbtColumn(ctx); | ||
} | ||
|
||
private void addNormalizationRepositoryColumn(final DSLContext ctx) { | ||
ctx.alterTable("actor_definition") | ||
.addColumnIfNotExists(DSL.field( | ||
"normalization_repository", | ||
SQLDataType.VARCHAR(256).nullable(true))) | ||
.execute(); | ||
} | ||
|
||
private void addNormalizationTagColumn(final DSLContext ctx) { | ||
ctx.alterTable("actor_definition") | ||
.addColumnIfNotExists(DSL.field( | ||
"normalization_tag", | ||
SQLDataType.VARCHAR(256).nullable(true))) | ||
.execute(); | ||
} | ||
|
||
public static void addSupportsDbtColumn(final DSLContext ctx) { | ||
ctx.alterTable("actor_definition") | ||
.addColumnIfNotExists(DSL.field("supports_dbt", | ||
SQLDataType.BOOLEAN.nullable(true))) | ||
.execute(); | ||
} | ||
|
||
} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.