diff --git a/.env b/.env index 835d51d..9b0cba1 100644 --- a/.env +++ b/.env @@ -6,10 +6,11 @@ POSTGRES_MIGRATIONS_PATH=./fixtures/postgres CLICKHOUSE_DSN=clickhouse://default:@clickhouse:9000/default?compress=true&debug=false CLICKHOUSE_MIGRATIONS_PATH=./fixtures/clickhouse -CLICKHOUSE_CLUSTER_DSN1=clickhouse://default:@clickhouse1:9000,clickhouse2:9000/default?compress=true&debug=false -CLICKHOUSE_CLUSTER_DSN2=clickhouse://default:@clickhouse2:9000/default?compress=true&debug=false +CLICKHOUSE_CLUSTER_DSN=clickhouse://default:@clickhouse1:9000,clickhouse2:9000/default?compress=true&debug=false +CLICKHOUSE_CLUSTER_R_DSN=clickhouse://default:@clickhouse-r-1:9000,clickhouse-r-2:9000/default?compress=true&debug=false&allow_experimental_database_replicated=1 CLICKHOUSE_CLUSTER_NAME=test_cluster CLICKHOUSE_CLUSTER_MIGRATIONS_PATH=./fixtures/clickhouse_cluster +CLICKHOUSE_CLUSTER_R_MIGRATIONS_PATH=./fixtures/clickhouse_cluster_replicated MYSQL_DSN=mysql://docker:docker@tcp(mysql:3306)/docker MYSQL_ROOT_PASSWORD=docker-pw diff --git a/Makefile b/Makefile index 4b3967d..0ee9855 100644 --- a/Makefile +++ b/Makefile @@ -125,3 +125,6 @@ gen-mocks-dry-run: install-mockery ## Run mockery --dry-run=true start: @docker-compose -f "docker-compose.yml" -f "docker-compose.dev.yml" up -d + +stop: + @docker-compose -f "docker-compose.yml" down --remove-orphans diff --git a/cmd/db-migrator/main.go b/cmd/db-migrator/main.go index d40cbf3..1dbbaff 100644 --- a/cmd/db-migrator/main.go +++ b/cmd/db-migrator/main.go @@ -151,6 +151,14 @@ func flags(options *migrator.Options) []cli.Flag { Usage: "Cluster name for history of migrates", Destination: &options.ClusterName, }, + &cli.BoolFlag{ + Name: "migrationReplicated", + Sources: cli.EnvVars("MIGRATION_REPLICATED"), + Aliases: []string{"cr"}, + Value: false, + Usage: "Using replicated experimental function to clickhouse for history table of migrates", + Destination: &options.Replicated, + }, &cli.BoolFlag{ Name: "compact", Sources: cli.EnvVars("COMPACT"), diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index c889e5d..f0d0d90 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,3 +3,7 @@ services: ports: - 9000:9000 - 8123:8123 + clickhouse-r-1: + ports: + - 19000:9000 + - 18123:8123 diff --git a/docker-compose.yml b/docker-compose.yml index 15971ca..521129b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,12 +26,16 @@ services: - clickhouse - clickhouse1 - clickhouse2 + - clickhouse-r-1 + - clickhouse-r-2 - postgres - mysql links: - clickhouse - clickhouse1 - clickhouse2 + - clickhouse-r-1 + - clickhouse-r-2 - postgres - mysql volumes: @@ -62,3 +66,27 @@ services: - "./docker/volume/clickhouse-cluster/config/clickhouse2:/etc/clickhouse-server/config.d/" depends_on: - clickhouse-keeper + + clickhouse-r-keeper: + image: clickhouse/clickhouse-keeper:23.11-alpine + restart: on-failure + volumes: + - "./docker/volume/clickhouse-cluster/config/keeper1/keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml" + + clickhouse-r-1: + image: clickhouse/clickhouse-server:23.11-alpine + restart: on-failure + volumes: + - "./docker/volume/clickhouse-cluster-replicated/config/clickhouse1:/etc/clickhouse-server/config.d/" + - "./docker/volume/clickhouse-cluster-replicated/config/clickhouse1/users.xml:/etc/clickhouse-server/users.d/users.xml" + depends_on: + - clickhouse-r-keeper + + clickhouse-r-2: + image: clickhouse/clickhouse-server:23.11-alpine + restart: on-failure + volumes: + - "./docker/volume/clickhouse-cluster-replicated/config/clickhouse2:/etc/clickhouse-server/config.d/" + - "./docker/volume/clickhouse-cluster-replicated/config/clickhouse2/users.xml:/etc/clickhouse-server/users.d/users.xml" + depends_on: + - clickhouse-r-keeper diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/config.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/config.xml new file mode 100644 index 0000000..c3483fb --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/config.xml @@ -0,0 +1,15 @@ + + + error + 1 + 10M + 3 + +0.0.0.0 +8123 +9000 + + + /clickhouse/task_queue/ddl + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/macros.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/macros.xml new file mode 100644 index 0000000..72ab6ba --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/macros.xml @@ -0,0 +1,10 @@ + + + /clickhouse/task_queue/ddl + + + 01 + clickhouse1 + test_cluster + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/remote_servers.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/remote_servers.xml new file mode 100644 index 0000000..96064ab --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/remote_servers.xml @@ -0,0 +1,17 @@ + + + + + true + + clickhouse1 + 9000 + + + clickhouse2 + 9000 + + + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/use_keeper.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/use_keeper.xml new file mode 100644 index 0000000..07e2ea4 --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/use_keeper.xml @@ -0,0 +1,8 @@ + + + + clickhouse-keeper + 9181 + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/users.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/users.xml new file mode 100644 index 0000000..494063e --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse1/users.xml @@ -0,0 +1,8 @@ + + + + 1 + null_status_on_timeout + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/config.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/config.xml new file mode 100644 index 0000000..66439e2 --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/config.xml @@ -0,0 +1,15 @@ + + + error + 1 + 10M + 3 + + 0.0.0.0 + 8123 + 9000 + + + /clickhouse/task_queue/ddl + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/macros.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/macros.xml new file mode 100644 index 0000000..6f53565 --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/macros.xml @@ -0,0 +1,10 @@ + + + /clickhouse/task_queue/ddl + + + 01 + clickhouse2 + test_cluster + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/remote_servers.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/remote_servers.xml new file mode 100644 index 0000000..96064ab --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/remote_servers.xml @@ -0,0 +1,17 @@ + + + + + true + + clickhouse1 + 9000 + + + clickhouse2 + 9000 + + + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/use_keeper.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/use_keeper.xml new file mode 100644 index 0000000..07e2ea4 --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/use_keeper.xml @@ -0,0 +1,8 @@ + + + + clickhouse-keeper + 9181 + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/users.xml b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/users.xml new file mode 100644 index 0000000..494063e --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/clickhouse2/users.xml @@ -0,0 +1,8 @@ + + + + 1 + null_status_on_timeout + + + diff --git a/docker/volume/clickhouse-cluster-replicated/config/keeper1/keeper_config.xml b/docker/volume/clickhouse-cluster-replicated/config/keeper1/keeper_config.xml new file mode 100644 index 0000000..e0c97dd --- /dev/null +++ b/docker/volume/clickhouse-cluster-replicated/config/keeper1/keeper_config.xml @@ -0,0 +1,28 @@ + + + information + /var/log/clickhouse-keeper/clickhouse-keeper.log + /var/log/clickhouse-keeper/clickhouse-keeper.err.log + 1000M + 3 + + 0.0.0.0 + + 9181 + 1 + /var/lib/clickhouse/coordination/log + /var/lib/clickhouse/coordination/snapshots + + 10000 + 30000 + information + + + + 1 + clickhouse-keeper + 9234 + + + + diff --git a/docker/volume/clickhouse-cluster/config/clickhouse1/config.xml b/docker/volume/clickhouse-cluster/config/clickhouse1/config.xml index 7e52396..66439e2 100644 --- a/docker/volume/clickhouse-cluster/config/clickhouse1/config.xml +++ b/docker/volume/clickhouse-cluster/config/clickhouse1/config.xml @@ -1,9 +1,8 @@ - debug - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M + error + 1 + 10M 3 0.0.0.0 diff --git a/docker/volume/clickhouse-cluster/config/clickhouse2/config.xml b/docker/volume/clickhouse-cluster/config/clickhouse2/config.xml index 7e52396..66439e2 100644 --- a/docker/volume/clickhouse-cluster/config/clickhouse2/config.xml +++ b/docker/volume/clickhouse-cluster/config/clickhouse2/config.xml @@ -1,9 +1,8 @@ - debug - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M + error + 1 + 10M 3 0.0.0.0 diff --git a/fixtures/clickhouse_cluster/200905_192800_create_test_table.up.sql b/fixtures/clickhouse_cluster/200905_192800_create_test_table.up.sql index 0f31a7c..ceb4695 100644 --- a/fixtures/clickhouse_cluster/200905_192800_create_test_table.up.sql +++ b/fixtures/clickhouse_cluster/200905_192800_create_test_table.up.sql @@ -1,10 +1,11 @@ -CREATE TABLE test ON CLUSTER test_cluster ( +CREATE DATABASE IF NOT EXISTS raw ON CLUSTER test_cluster; + +CREATE TABLE raw.test ON CLUSTER test_cluster ( time DateTime DEFAULT now(), value UInt32 - ) ENGINE = ReplicatedMergeTree ( - '/clickhouse/tables/{shard}/test_cluster_test', + '/clickhouse/tables/{shard}/raw_test_cluster_test', '{replica}' ) PARTITION BY toYYYYMM(time) diff --git a/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.down.sql b/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.down.sql index 760f0d8..954343e 100644 --- a/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.down.sql +++ b/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.down.sql @@ -1,3 +1,3 @@ -ALTER TABLE test ON CLUSTER test_cluster +ALTER TABLE raw.test ON CLUSTER test_cluster DROP COLUMN text; diff --git a/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.up.sql b/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.up.sql index 53c0a93..0315653 100644 --- a/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.up.sql +++ b/fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.up.sql @@ -1,4 +1,4 @@ -ALTER TABLE test ON CLUSTER test_cluster +ALTER TABLE raw.test ON CLUSTER test_cluster ADD COLUMN text String; -INSERT INTO test (value, text) VALUES (1, 'Hello'); +INSERT INTO raw.test (value, text) VALUES (1, 'Hello'); diff --git a/fixtures/clickhouse_cluster/210327_230201_broken_migration.safe.up.sql b/fixtures/clickhouse_cluster/210327_230201_broken_migration.safe.up.sql index 53e93a2..0bffd81 100644 --- a/fixtures/clickhouse_cluster/210327_230201_broken_migration.safe.up.sql +++ b/fixtures/clickhouse_cluster/210327_230201_broken_migration.safe.up.sql @@ -1 +1 @@ -INSERT INTO test2 (time) VALUES (now()); +INSERT INTO raw.test2 (time) VALUES (now()); diff --git a/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.down.sql b/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.down.sql new file mode 100644 index 0000000..8d67feb --- /dev/null +++ b/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.down.sql @@ -0,0 +1 @@ +DROP TABLE raw.test NO DELAY; diff --git a/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.up.sql b/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.up.sql new file mode 100644 index 0000000..5deaa19 --- /dev/null +++ b/fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.up.sql @@ -0,0 +1,13 @@ +CREATE DATABASE IF NOT EXISTS raw +ENGINE = Replicated('/clickhouse/databases/{shard}/raw', '{shard}', '{replica}'); + +CREATE TABLE IF NOT EXISTS raw.test ( + time DateTime DEFAULT now(), + value UInt32 +) +ENGINE = ReplicatedMergeTree ( + '/clickhouse/tables/{shard}/raw_test_cluster_test', + '{replica}' +) +PARTITION BY toYYYYMM(time) +ORDER BY (time, value); diff --git a/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.down.sql b/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.down.sql new file mode 100644 index 0000000..844b635 --- /dev/null +++ b/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.down.sql @@ -0,0 +1 @@ +ALTER TABLE raw.test DROP COLUMN text; diff --git a/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.up.sql b/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.up.sql new file mode 100644 index 0000000..506985f --- /dev/null +++ b/fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE raw.test ADD COLUMN text String; + +INSERT INTO raw.test (value, text) VALUES (1, 'Hello'); diff --git a/fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.down.sql b/fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.down.sql new file mode 100644 index 0000000..e69de29 diff --git a/fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.up.sql b/fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.up.sql new file mode 100644 index 0000000..0bffd81 --- /dev/null +++ b/fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.up.sql @@ -0,0 +1 @@ +INSERT INTO raw.test2 (time) VALUES (now()); diff --git a/internal/bak/migrator_clickhouse_cluster_integration_test.go.bak b/internal/bak/migrator_clickhouse_cluster_integration_test.go.bak index 8253069..2061f1a 100644 --- a/internal/bak/migrator_clickhouse_cluster_integration_test.go.bak +++ b/internal/bak/migrator_clickhouse_cluster_integration_test.go.bak @@ -42,7 +42,7 @@ func TestMigrateService_ClickHouseCluster_UpDown(t *testing.T) { func createClickhouse1ClusterMigrator() (*Service, error) { return New(&Options{ - DSN: os.Getenv("CLICKHOUSE_CLUSTER_DSN1"), + DSN: os.Getenv("CLICKHOUSE_CLUSTER_DSN"), Directory: os.Getenv("CLICKHOUSE_CLUSTER_MIGRATIONS_PATH"), TableName: "migration", ClusterName: os.Getenv("CLICKHOUSE_CLUSTER_NAME"), diff --git a/internal/dal/repository/clickhouse.go b/internal/dal/repository/clickhouse.go index 8f235a7..fa8b64c 100644 --- a/internal/dal/repository/clickhouse.go +++ b/internal/dal/repository/clickhouse.go @@ -138,41 +138,46 @@ func (c *Clickhouse) ExecQueryTransaction(ctx context.Context, txFn func(ctx con // CreateMigrationHistoryTable creates a new migration history table. func (c *Clickhouse) CreateMigrationHistoryTable(ctx context.Context) error { - var q string - if c.options.ClusterName == "" { - q = fmt.Sprintf( - ` + var ( + q string + engine string + tableName string + ) + + switch { + case !c.options.Replicated && len(c.options.ClusterName) > 0: + tableName = c.options.TableName + " ON CLUSTER " + c.options.ClusterName + engine = "ReplicatedReplacingMergeTree('/clickhouse/tables/{shard}/" + + c.options.ClusterName + "_" + c.options.TableName + "', '{replica}', apply_time)" + case c.options.Replicated: + tableName = c.options.TableName + engine = "ReplicatedReplacingMergeTree('/clickhouse/tables/{shard}/" + + c.options.ClusterName + "_" + c.options.TableName + "', '{replica}', apply_time)" + default: + tableName = c.options.TableName + engine = "ReplacingMergeTree(apply_time)" + } + if !c.options.Replicated && len(c.options.ClusterName) > 0 { + tableName += " ON CLUSTER " + c.options.ClusterName + engine = "ReplicatedReplacingMergeTree('/clickhouse/tables/{shard}/" + + c.options.ClusterName + "_" + c.options.TableName + "', '{replica}', apply_time)" + } + + q = fmt.Sprintf( + ` CREATE TABLE %s ( version String, date Date DEFAULT toDate(apply_time), apply_time UInt32, is_deleted UInt8 - ) ENGINE = ReplacingMergeTree(apply_time) - PRIMARY KEY (version) - PARTITION BY (toYYYYMM(date)) - ORDER BY (version) - SETTINGS index_granularity=8192 - `, - c.options.TableName, - ) - } else { - q = fmt.Sprintf( - ` - CREATE TABLE %[1]s ON CLUSTER %[2]s ( - version String, - date Date DEFAULT toDate(apply_time), - apply_time UInt32, - is_deleted UInt8 - ) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/{shard}/%[2]s_%[1]s', '{replica}', apply_time) + ) ENGINE = %s PRIMARY KEY (version) PARTITION BY (toYYYYMM(date)) ORDER BY (version) SETTINGS index_granularity=8192 `, - c.options.TableName, - c.options.ClusterName, - ) - } + tableName, engine, + ) if _, err := c.conn.ExecContext(ctx, q); err != nil { return errors.Wrap(c.dbError(err, q), "create migration history table") @@ -244,7 +249,7 @@ func (c *Clickhouse) insertMigration(ctx context.Context, version string, isDele // optimizeTable optimizes tables. func (c *Clickhouse) optimizeTable(ctx context.Context) error { var q string - if c.options.ClusterName == "" { + if c.options.Replicated || c.options.ClusterName == "" { q = fmt.Sprintf("OPTIMIZE TABLE %s FINAL", c.options.TableName) } else { q = fmt.Sprintf("OPTIMIZE TABLE %s ON CLUSTER %s FINAL", c.options.TableName, c.options.ClusterName) diff --git a/internal/dal/repository/options.go b/internal/dal/repository/options.go index d5f6122..7edfcf7 100644 --- a/internal/dal/repository/options.go +++ b/internal/dal/repository/options.go @@ -4,5 +4,6 @@ type Options struct { TableName string SchemaName string ClusterName string + Replicated bool ShardName string } diff --git a/internal/migrator/db_service.go b/internal/migrator/db_service.go index 349bae1..1aaac33 100644 --- a/internal/migrator/db_service.go +++ b/internal/migrator/db_service.go @@ -33,6 +33,7 @@ type ( Directory string TableName string ClusterName string + Replicated bool Compact bool Interactive bool MaxSQLOutputLength int @@ -128,6 +129,7 @@ func (s *DBService) migrationService() (*service.Migration, error) { &repository.Options{ TableName: s.options.TableName, ClusterName: s.options.ClusterName, + Replicated: s.options.Replicated, }, ) if err != nil { diff --git a/internal/migrator/db_service_integration_test.go b/internal/migrator/db_service_integration_test.go index 5023f9e..5d26bc3 100644 --- a/internal/migrator/db_service_integration_test.go +++ b/internal/migrator/db_service_integration_test.go @@ -17,7 +17,7 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { t.Skip("skipping integration test") } - if os.Getenv("CLICKHOUSE_CLUSTER_DSN1") == "" { + if os.Getenv("CLICKHOUSE_CLUSTER_DSN") == "" { if err := godotenv.Load("../../.env"); err != nil { require.NoError(t, err, "Load environments") } @@ -25,9 +25,9 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { // region data provider tests := []struct { - name string - countMigrationsSQL string - options *Options + name string + selectQuery string + options *Options }{ { name: "postgres", @@ -62,7 +62,7 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { { name: "clickhouse_cluster", options: &Options{ - DSN: os.Getenv("CLICKHOUSE_CLUSTER_DSN1"), + DSN: os.Getenv("CLICKHOUSE_CLUSTER_DSN"), Directory: migrationsPathAbs(os.Getenv("CLICKHOUSE_CLUSTER_MIGRATIONS_PATH")), TableName: "migration", ClusterName: os.Getenv("CLICKHOUSE_CLUSTER_NAME"), @@ -70,6 +70,18 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { Interactive: false, }, }, + { + name: "clickhouse_cluster_replicated", + selectQuery: "select * from raw.test", + options: &Options{ + DSN: os.Getenv("CLICKHOUSE_CLUSTER_R_DSN"), + Replicated: true, + Directory: migrationsPathAbs(os.Getenv("CLICKHOUSE_CLUSTER_R_MIGRATIONS_PATH")), + TableName: "migration", + Compact: true, + Interactive: false, + }, + }, } // endregion @@ -94,7 +106,7 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { err = up.Run(ctx, "1") // migration with error assert.Error(t, err) assertEqualRowsCount(t, ctx, dbServ.repo, 3) - err = dbServ.repo.ExecQuery(ctx, "select * from test") // checks table exists + err = dbServ.repo.ExecQuery(ctx, tt.selectQuery) // checks table exists assert.NoError(t, err) err = down.Run(ctx, "all") @@ -105,9 +117,9 @@ func TestIntegrationDBService_UpDown_Successfully(t *testing.T) { } func TestIntegrationDBService_Upgrade_AlreadyExistsMigration(t *testing.T) { - if testing.Short() { - t.Skip("skipping integration test") - } + //if testing.Short() { + t.Skip("skipping integration test") + //} ctx := context.Background() opts := Options{ DSN: os.Getenv("POSTGRES_DSN"),