mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-26 15:39:01 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using RadicadeServer.DB;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RadicadeServer.Migrations
|
||||
{
|
||||
[DbContext(typeof(RecDBContext))]
|
||||
[Migration("20260928000000_AddModerationStartAndNote")]
|
||||
public partial class AddModerationStartAndNote : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH(N'dbo.Moderation', N'CreatedAt') IS NULL
|
||||
ALTER TABLE [dbo].[Moderation] ADD [CreatedAt] datetime2 NOT NULL CONSTRAINT [DF_Moderation_CreatedAt] DEFAULT GETUTCDATE();
|
||||
IF COL_LENGTH(N'dbo.Moderation', N'ModeratorNote') IS NULL
|
||||
ALTER TABLE [dbo].[Moderation] ADD [ModeratorNote] nvarchar(max) NULL;");
|
||||
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH(N'dbo.Moderation', N'ModeratorNote') IS NOT NULL ALTER TABLE [dbo].[Moderation] DROP COLUMN [ModeratorNote];
|
||||
IF COL_LENGTH(N'dbo.Moderation', N'CreatedAt') IS NOT NULL ALTER TABLE [dbo].[Moderation] DROP COLUMN [CreatedAt];");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user