File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
airbyte-bootloader/src/test/java/io/airbyte/bootloader
airbyte-db/db-lib/src/main
java/io/airbyte/db/instance/configs/migrations
resources/configs_database Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ void testBootloaderAppBlankDb() throws Exception {
141
141
val configsMigrator = new ConfigsDatabaseMigrator (configDatabase , configsFlyway );
142
142
// this line should change with every new migration
143
143
// to show that you meant to make a new migration to the prod database
144
- assertEquals ("0.40.12 .001" , configsMigrator .getLatestMigration ().getVersion ().getVersion ());
144
+ assertEquals ("0.40.18 .001" , configsMigrator .getLatestMigration ().getVersion ().getVersion ());
145
145
146
146
val jobsPersistence = new DefaultJobPersistence (jobDatabase );
147
147
assertEquals (VERSION_0330_ALPHA , jobsPersistence .getVersion ().get ());
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3
+ */
4
+
5
+ package io .airbyte .db .instance .configs .migrations ;
6
+
7
+ import org .flywaydb .core .api .migration .BaseJavaMigration ;
8
+ import org .flywaydb .core .api .migration .Context ;
9
+ import org .jooq .DSLContext ;
10
+ import org .jooq .impl .DSL ;
11
+ import org .jooq .impl .SQLDataType ;
12
+ import org .slf4j .Logger ;
13
+ import org .slf4j .LoggerFactory ;
14
+
15
+ public class V0_40_18_001__AddInvalidProtocolFlagToConnections extends BaseJavaMigration {
16
+
17
+ private static final Logger LOGGER = LoggerFactory .getLogger (V0_40_18_001__AddInvalidProtocolFlagToConnections .class );
18
+
19
+ @ Override
20
+ public void migrate (final Context context ) throws Exception {
21
+ LOGGER .info ("Running migration: {}" , this .getClass ().getSimpleName ());
22
+
23
+ // Warning: please do not use any jOOQ generated code to write a migration.
24
+ // As database schema changes, the generated jOOQ code can be deprecated. So
25
+ // old migration may not compile if there is any generated code.
26
+ final DSLContext ctx = DSL .using (context .getConnection ());
27
+ addInvalidProtocolFlagToConnections (ctx );
28
+ }
29
+
30
+ private void addInvalidProtocolFlagToConnections (final DSLContext ctx ) {
31
+ ctx .alterTable ("connection" )
32
+ .addColumn (DSL .field ("unsupported_protocol_version" , SQLDataType .BOOLEAN .nullable (false ).defaultValue (false )))
33
+ .execute ();
34
+ }
35
+
36
+ }
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ create table "public"."connection"(
108
108
"notify_schema_changes" bool not null default true,
109
109
"non_breaking_change_preference" varchar(7) not null default '''ignore''::character varying',
110
110
"breaking_change" bool not null default false,
111
+ "unsupported_protocol_version" bool not null default false,
111
112
constraint "connection_pkey"
112
113
primary key ("id")
113
114
);
You can’t perform that action at this time.
0 commit comments