using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace gehGassi.Persistence.Migrations { public partial class BannerStatisticsAdded : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "BannerStatistics", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), BannerId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), AppMode = table.Column(type: "int", nullable: false), EventDate = table.Column(type: "datetimeoffset", nullable: false), Year = table.Column(type: "int", nullable: false), Month = table.Column(type: "int", nullable: false), Day = table.Column(type: "int", nullable: false), Hour = table.Column(type: "int", nullable: false), StatisticType = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Language = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), CountryCode = table.Column(type: "nvarchar(2)", maxLength: 2, nullable: false), StateCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true) }, constraints: table => { table.PrimaryKey("PK_BannerStatistics", x => x.Id); table.ForeignKey( name: "FK_BannerStatistics_Banners_BannerId", column: x => x.BannerId, principalTable: "Banners", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_BannerStatistics_BannerId", table: "BannerStatistics", column: "BannerId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "BannerStatistics"); } } }