From 0505fc6ac6d8ec76befc4f56dcb4acea074f45f9 Mon Sep 17 00:00:00 2001 From: divyam234 <47589864+divyam234@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:45:16 +0530 Subject: [PATCH] fix bots tbale constraint --- internal/cron/cron.go | 2 +- .../migrations/20240120151952_modify_constraint.sql | 6 ++++++ ui/teldrive-ui | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 pkg/database/migrations/20240120151952_modify_constraint.sql diff --git a/internal/cron/cron.go b/internal/cron/cron.go index 8c409f2..642ac25 100644 --- a/internal/cron/cron.go +++ b/internal/cron/cron.go @@ -200,7 +200,7 @@ func uploadCleanJob(logger *zap.Logger) { func folderSizeUpdate(logger *zap.Logger) { database.DB.Exec("call teldrive.update_size();") - logger.Info("updates folder sizes") + logger.Info("updated folder sizes") } diff --git a/pkg/database/migrations/20240120151952_modify_constraint.sql b/pkg/database/migrations/20240120151952_modify_constraint.sql new file mode 100644 index 0000000..3dc1da8 --- /dev/null +++ b/pkg/database/migrations/20240120151952_modify_constraint.sql @@ -0,0 +1,6 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE teldrive.bots DROP CONSTRAINT IF EXISTS btoken_user_un; +ALTER TABLE teldrive.bots DROP CONSTRAINT IF EXISTS btoken_user_channel_un; +ALTER TABLE teldrive.bots ADD CONSTRAINT btoken_user_channel_un UNIQUE (user_id,token,channel_id); +-- +goose StatementEnd \ No newline at end of file diff --git a/ui/teldrive-ui b/ui/teldrive-ui index 1ae405f..ba03365 160000 --- a/ui/teldrive-ui +++ b/ui/teldrive-ui @@ -1 +1 @@ -Subproject commit 1ae405f113ebe394390e9611fb774636aab7e501 +Subproject commit ba0336510bf348ba0b95722e1b620de5fb296a38