forked from MDCPS/DamageAssessment_Backend
Azure Migrations
This commit is contained in:
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace DamageAssesment.Api.Questions.Migrations
|
||||
{
|
||||
[DbContext(typeof(QuestionDbContext))]
|
||||
[Migration("20230817215744_InitialQuestion")]
|
||||
partial class InitialQuestion
|
||||
[Migration("20230927211340_AzureQuestions")]
|
||||
partial class AzureQuestions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -25,6 +25,30 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DamageAssesment.Api.Questions.Db.CategoryTranslation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CategoryId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Language")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CategoryTranslations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DamageAssesment.Api.Questions.Db.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@ -45,10 +69,6 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
b.Property<bool>("Key")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("QuestionGroup")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("QuestionNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -73,11 +93,11 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CategoryImage")
|
||||
b.Property<string>("IconLibrary")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CategoryName")
|
||||
b.Property<string>("IconName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
@ -5,19 +5,34 @@
|
||||
namespace DamageAssesment.Api.Questions.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialQuestion : Migration
|
||||
public partial class AzureQuestions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CategoryTranslations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CategoryId = table.Column<int>(type: "int", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Language = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CategoryTranslations", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "QuestionCategories",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CategoryName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CategoryImage = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
IconName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IconLibrary = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -64,7 +79,6 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
Comment = table.Column<bool>(type: "bit", nullable: false),
|
||||
Key = table.Column<bool>(type: "bit", nullable: false),
|
||||
SurveyId = table.Column<int>(type: "int", nullable: true),
|
||||
QuestionGroup = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CategoryId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
@ -87,6 +101,9 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CategoryTranslations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "QuestionCategories");
|
||||
|
@ -22,6 +22,30 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DamageAssesment.Api.Questions.Db.CategoryTranslation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CategoryId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Language")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CategoryTranslations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DamageAssesment.Api.Questions.Db.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@ -42,10 +66,6 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
b.Property<bool>("Key")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("QuestionGroup")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("QuestionNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -70,11 +90,11 @@ namespace DamageAssesment.Api.Questions.Migrations
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CategoryImage")
|
||||
b.Property<string>("IconLibrary")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CategoryName")
|
||||
b.Property<string>("IconName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
|
Reference in New Issue
Block a user