From 6f511ddc53fe4e15a9059995a5e66ed20e612ce4 Mon Sep 17 00:00:00 2001 From: DeniskaRediska Date: Wed, 11 May 2022 15:47:52 +0300 Subject: [PATCH] MSP-625 remove db cli --- main.go | 2 -- migrations/00001_2019-11-14_init.sql | 9 --------- migrations/00002_2019-11-19_add_requests.sql | 12 ------------ migrations/00003_2019-11-25_update_snapshot.sql | 6 ------ repository/client.go | 17 ----------------- 5 files changed, 46 deletions(-) delete mode 100644 migrations/00001_2019-11-14_init.sql delete mode 100644 migrations/00002_2019-11-19_add_requests.sql delete mode 100644 migrations/00003_2019-11-25_update_snapshot.sql delete mode 100644 repository/client.go diff --git a/main.go b/main.go index e304706..54aaa86 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,6 @@ import ( "isp-gate-service/conf" "isp-gate-service/proxy" "isp-gate-service/redis" - "isp-gate-service/repository" "isp-gate-service/routing" "isp-gate-service/server" "isp-gate-service/service" @@ -61,7 +60,6 @@ func onLocalConfigLoad(_ *conf.Configuration) { } func onRemoteConfigReceive(remoteConfig, oldRemoteConfig *conf.RemoteConfig) { - repository.DbClient.ReceiveConfiguration(remoteConfig.Database) matcher.JournalMethods = matcher.NewAtLeastOneMatcher(remoteConfig.JournalSetting.MethodsPatterns) redis.Client.ReceiveConfiguration(remoteConfig.Redis) diff --git a/migrations/00001_2019-11-14_init.sql b/migrations/00001_2019-11-14_init.sql deleted file mode 100644 index 5a1c2c4..0000000 --- a/migrations/00001_2019-11-14_init.sql +++ /dev/null @@ -1,9 +0,0 @@ --- +goose Up - -CREATE TABLE snapshot( - app_id INTEGER PRIMARY KEY, - limit_state JSONB -); - --- +goose Down -DROP SCHEMA IF EXISTS gate_service CASCADE; \ No newline at end of file diff --git a/migrations/00002_2019-11-19_add_requests.sql b/migrations/00002_2019-11-19_add_requests.sql deleted file mode 100644 index a7de482..0000000 --- a/migrations/00002_2019-11-19_add_requests.sql +++ /dev/null @@ -1,12 +0,0 @@ --- +goose Up - -CREATE TABLE requests -( - id SERIAL8 PRIMARY KEY, - app_id INT4 NOT NULL, - method VARCHAR(255) NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT now() -); - --- +goose Down -DROP TABLE requests; diff --git a/migrations/00003_2019-11-25_update_snapshot.sql b/migrations/00003_2019-11-25_update_snapshot.sql deleted file mode 100644 index e69a04b..0000000 --- a/migrations/00003_2019-11-25_update_snapshot.sql +++ /dev/null @@ -1,6 +0,0 @@ --- +goose Up - -ALTER TABLE snapshot - ADD version BIGINT NOT NULL DEFAULT 0; - --- +goose Down \ No newline at end of file diff --git a/repository/client.go b/repository/client.go deleted file mode 100644 index b98d8e5..0000000 --- a/repository/client.go +++ /dev/null @@ -1,17 +0,0 @@ -package repository - -import ( - "github.com/integration-system/isp-lib/v2/database" - log "github.com/integration-system/isp-log" - "isp-gate-service/log_code" -) - -var ( - DbClient = database.NewRxDbClient( - database.WithSchemaEnsuring(), - database.WithSchemaAutoInjecting(), - database.WithMigrationsEnsuring(), - database.WithInitializingErrorHandler(func(err *database.ErrorEvent) { - log.Error(log_code.ErrorClientDatabase, err) - })) -)