using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.Migrations { /// public partial class EventOccurrence : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EventOccurrences", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), EventDefinitionId = table.Column(type: "INTEGER", nullable: true), SpecialEventType = table.Column(type: "TEXT", maxLength: 50, nullable: true), Name = table.Column(type: "TEXT", maxLength: 200, nullable: false), Time = table.Column(type: "TEXT", maxLength: 100, nullable: false), Date = table.Column(type: "TEXT", maxLength: 100, nullable: false), StartTime = table.Column(type: "TEXT", nullable: false), EndTime = table.Column(type: "TEXT", nullable: true), Location = table.Column(type: "TEXT", maxLength: 500, nullable: true) }, constraints: table => { table.PrimaryKey("PK_EventOccurrences", x => x.Id); table.ForeignKey( name: "FK_EventOccurrences_Events_EventDefinitionId", column: x => x.EventDefinitionId, principalTable: "Events", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_EventOccurrences_EventDefinitionId", table: "EventOccurrences", column: "EventDefinitionId"); migrationBuilder.CreateIndex( name: "IX_EventOccurrences_SpecialEventType", table: "EventOccurrences", column: "SpecialEventType"); migrationBuilder.CreateIndex( name: "IX_EventOccurrences_StartTime", table: "EventOccurrences", column: "StartTime"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EventOccurrences"); } } }