using Data.SeaHavenIndustries;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
///
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260717140000_AddEventsCalendarTable")]
public partial class AddEventsCalendarTable : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
// Events entity existed in the model/DbSet without a discoverable migration.
migrationBuilder.Sql(@"
IF OBJECT_ID(N'dbo.Events', N'U') IS NULL
BEGIN
CREATE TABLE Events (
Id int NOT NULL IDENTITY(1,1),
Title nvarchar(100) NOT NULL,
Description nvarchar(max) NULL,
Location nvarchar(150) NULL,
RecordID int NULL,
RecordName nvarchar(max) NULL,
RecordTargetType nvarchar(max) NULL,
ReminderMinutes int NOT NULL,
EventColor nvarchar(20) NOT NULL,
StartDate datetime2 NOT NULL,
StartTime nvarchar(10) NULL,
EndDate datetime2 NOT NULL,
EndTime nvarchar(10) NULL,
AllDay bit NOT NULL,
IsDeleted bit NULL,
createdby nvarchar(max) NULL,
DeleterUserId nvarchar(max) NULL,
DeletionTime datetime2 NULL,
CreatedDate datetime2 NULL,
LastModificationTime datetime2 NULL,
LastModifierUserId int NULL,
CONSTRAINT PK_Events PRIMARY KEY (Id)
);
END
");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"
IF OBJECT_ID(N'dbo.Events', N'U') IS NOT NULL
DROP TABLE Events;
");
}
}
}