diff --git a/models/dbsql/repo_foreigntable_for_es.sql b/models/dbsql/repo_foreigntable_for_es.sql index 0b09f576d..3637853cd 100644 --- a/models/dbsql/repo_foreigntable_for_es.sql +++ b/models/dbsql/repo_foreigntable_for_es.sql @@ -1,3 +1,4 @@ +DROP FOREIGN TABLE public.repository_es; CREATE FOREIGN TABLE public.repository_es ( id bigint NOT NULL, owner_id bigint, @@ -30,7 +31,7 @@ CREATE FOREIGN TABLE public.repository_es ( size bigint DEFAULT 0 NOT NULL, is_fsck_enabled boolean DEFAULT true NOT NULL, close_issues_via_commit_in_any_branch boolean DEFAULT false NOT NULL, - topics json, + topics text, avatar character varying(64), created_unix bigint, updated_unix bigint, @@ -145,6 +146,7 @@ LANGUAGE plpgsql; DROP TRIGGER IF EXISTS es_insert_repository on public.repository; + CREATE TRIGGER es_insert_repository AFTER INSERT ON public.repository FOR EACH ROW EXECUTE PROCEDURE insert_repository_data(); @@ -160,7 +162,17 @@ $def$ $def$ LANGUAGE plpgsql; + DROP TRIGGER IF EXISTS es_update_repository_description on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_name on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_ownername on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_website on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_topics on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_updated_unix on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_num_watches on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_num_stars on public.repository; +DROP TRIGGER IF EXISTS es_update_repository_num_forks on public.repository; +DROP TRIGGER IF EXISTS es_delete_repository on public.repository; CREATE TRIGGER es_update_repository_description AFTER UPDATE OF "description" ON public.repository diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index da505d84e..22b551206 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -114,7 +114,8 @@ func SaveNewNameModel(ctx *context.Context) { aimodels := models.QueryModelByName(name, ctx.Repo.Repository.ID) if len(aimodels) > 0 { - ctx.ServerError("Name error.", errors.New(ctx.Tr("repo.model_noright"))) + ctx.Error(500, ctx.Tr("repo.model_rename")) + return } SaveModel(ctx)