From 30aa9531ec19b5c8e7fde36ed8c85b832b198bb0 Mon Sep 17 00:00:00 2001 From: romanskijdev Date: Thu, 18 Jun 2026 13:43:48 +0300 Subject: [PATCH] fixed swagger docs generation --- core/db/db_migration/tables/user.go | 3 +-- deploy.sh | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/db/db_migration/tables/user.go b/core/db/db_migration/tables/user.go index 5893d70..e7e455a 100644 --- a/core/db/db_migration/tables/user.go +++ b/core/db/db_migration/tables/user.go @@ -15,8 +15,7 @@ func UsersTableMigrate(db *gorm.DB) error { if !hasTable { time.Sleep(5 * time.Second) - db.Exec(`ALTER TABLE users ADD CONSTRAINT fk_users_department_id FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE SET NULL ON UPDATE CASCADE`) - + db.Exec(`ALTER TABLE users ADD CONSTRAINT fk_users_department_id FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE CASCADE ON UPDATE CASCADE`) execComments(db, ` COMMENT ON TABLE "users" IS 'Сотрудники компании РусПЭТ'; COMMENT ON COLUMN "users".id IS 'Внутренний ID пользователя'; diff --git a/deploy.sh b/deploy.sh index 36b2dbf..b5d55d3 100644 --- a/deploy.sh +++ b/deploy.sh @@ -151,6 +151,7 @@ if [ "$SERVICE_TYPE" = "admin" ] && [ "$GENERATE_SWAGGER" = "swagger" ]; then mv ./docs "$SERVICE_PATH/docs" log_success "Swagger documentation moved to service root" fi + sudo chown -R git:git "$SERVICE_PATH/docs" cd "$SERVICE_PATH" else