Изменение метода отчистки таблицы.

This commit is contained in:
2025-05-12 16:01:10 +04:00
parent 53baa87144
commit a9f9ae4b93
6 changed files with 113 additions and 181 deletions
@@ -12,25 +12,6 @@ public partial class Function : Migration
{
migrationBuilder.Sql(
"""
CREATE OR REPLACE FUNCTION f_truncate_tables()
RETURNS void
LANGUAGE plpgsql AS
$func$
BEGIN
EXECUTE
(SELECT 'TRUNCATE TABLE '
|| string_agg(format('%I.%I', schemaname, tablename), ', ')
|| ' CASCADE;'
FROM pg_tables
WHERE schemaname = 'public'
AND tablename != '__EFMigrationsHistory'
);
END
$func$;
"""
);
migrationBuilder.Sql(
"""
CREATE OR REPLACE FUNCTION f_drop_tables()
RETURNS void
LANGUAGE plpgsql AS