From a859eef3c597a0d138c32aac3cd5ac9ab9bd04e9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Tue, 13 Feb 2024 00:55:48 +0100 Subject: [PATCH] [backend/database] Fix database bootstrap --- .../Migrations/20240212005032_AddDatabaseFunctions.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Iceshrimp.Backend/Core/Database/Migrations/20240212005032_AddDatabaseFunctions.cs b/Iceshrimp.Backend/Core/Database/Migrations/20240212005032_AddDatabaseFunctions.cs index 434fbe4e..ff971f03 100644 --- a/Iceshrimp.Backend/Core/Database/Migrations/20240212005032_AddDatabaseFunctions.cs +++ b/Iceshrimp.Backend/Core/Database/Migrations/20240212005032_AddDatabaseFunctions.cs @@ -11,8 +11,8 @@ namespace Iceshrimp.Backend.Core.Database.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.Sql(""" - DROP FUNCTION public.note_ancestors; - CREATE OR REPLACE FUNCTION public.note_ancestors (start_id character varying, max_depth integer) + DROP FUNCTION IF EXISTS public.note_ancestors; + CREATE FUNCTION public.note_ancestors (start_id character varying, max_depth integer) RETURNS SETOF "note" LANGUAGE sql AS $function$ @@ -45,7 +45,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations """); migrationBuilder.Sql(""" - DROP FUNCTION public.note_descendants; + DROP FUNCTION IF EXISTS public.note_descendants; CREATE FUNCTION public.note_descendants (start_id character varying, max_depth integer, max_breadth integer) RETURNS SETOF "note" LANGUAGE sql @@ -100,7 +100,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.Sql(""" - DROP FUNCTION public.note_ancestors; + DROP FUNCTION IF EXISTS public.note_ancestors; CREATE FUNCTION public.note_ancestors (start_id character varying, max_depth integer) RETURNS TABLE ( id character varying) @@ -138,7 +138,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations """); migrationBuilder.Sql(""" - DROP FUNCTION public.note_descendants; + DROP FUNCTION IF EXISTS public.note_descendants; CREATE FUNCTION public.note_descendants (start_id character varying, max_depth integer, max_breadth integer) RETURNS TABLE ( id character varying)