fix: add migrations for stored procedure and privacy field in playlists
This commit is contained in:
32
Migrations/00000000000000_StoredProcedure.cs
Normal file
32
Migrations/00000000000000_StoredProcedure.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Shadow.Migrations;
|
||||
public partial class _00000000000000_StoredProcedure : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
|
||||
CREATE OR REPLACE PROCEDURE song_cleanup()
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
DELETE FROM "Songs"
|
||||
WHERE "State" = 0;
|
||||
|
||||
COMMIT;
|
||||
END;
|
||||
$$;
|
||||
|
||||
""");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
DROP PROCEDURE IF EXISTS song_cleanup();
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user