Calender tables migration fixed

This commit is contained in:
2023-06-04 23:46:34 +02:00
parent 0e8c8f179c
commit 1089f31c1a
3 changed files with 371 additions and 0 deletions

View File

@ -0,0 +1,179 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyYearlyCountings.Data;
#nullable disable
namespace MyYearlyCountings.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20230604213025_CalenderTables")]
partial class CalenderTables
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.5");
modelBuilder.Entity("MyYearlyCountings.Models.AccountRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Avisering")
.IsRequired()
.HasColumnType("TEXT");
b.Property<double>("Belopp")
.HasColumnType("REAL");
b.Property<DateTime>("BetalDatum")
.HasColumnType("TEXT");
b.Property<string>("Konto")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Mottagare")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("AccountRecords");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalDay", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Day")
.HasColumnType("INTEGER");
b.Property<string>("DayComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("DayName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalDays");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalHour", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Day")
.HasColumnType("INTEGER");
b.Property<int>("Hour")
.HasColumnType("INTEGER");
b.Property<string>("HourComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalHours");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalMonth", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<string>("MonthComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("MonthName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalMonths");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalYear", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.Property<string>("YearComment")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("CalYears");
});
modelBuilder.Entity("MyYearlyCountings.Models.Member", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("NickName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PersonType")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Members");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,94 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MyYearlyCountings.Migrations
{
/// <inheritdoc />
public partial class CalenderTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CalDays",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Year = table.Column<int>(type: "INTEGER", nullable: false),
Month = table.Column<int>(type: "INTEGER", nullable: false),
Day = table.Column<int>(type: "INTEGER", nullable: false),
DayName = table.Column<string>(type: "TEXT", nullable: false),
DayComment = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CalDays", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CalHours",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Year = table.Column<int>(type: "INTEGER", nullable: false),
Month = table.Column<int>(type: "INTEGER", nullable: false),
Day = table.Column<int>(type: "INTEGER", nullable: false),
Hour = table.Column<int>(type: "INTEGER", nullable: false),
HourComment = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CalHours", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CalMonths",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Year = table.Column<int>(type: "INTEGER", nullable: false),
Month = table.Column<int>(type: "INTEGER", nullable: false),
MonthName = table.Column<string>(type: "TEXT", nullable: false),
MonthComment = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CalMonths", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CalYears",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Year = table.Column<int>(type: "INTEGER", nullable: false),
YearComment = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CalYears", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CalDays");
migrationBuilder.DropTable(
name: "CalHours");
migrationBuilder.DropTable(
name: "CalMonths");
migrationBuilder.DropTable(
name: "CalYears");
}
}
}

View File

@ -46,6 +46,104 @@ namespace MyYearlyCountings.Migrations
b.ToTable("AccountRecords"); b.ToTable("AccountRecords");
}); });
modelBuilder.Entity("MyYearlyCountings.Models.CalDay", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Day")
.HasColumnType("INTEGER");
b.Property<string>("DayComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("DayName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalDays");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalHour", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Day")
.HasColumnType("INTEGER");
b.Property<int>("Hour")
.HasColumnType("INTEGER");
b.Property<string>("HourComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalHours");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalMonth", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Month")
.HasColumnType("INTEGER");
b.Property<string>("MonthComment")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("MonthName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("CalMonths");
});
modelBuilder.Entity("MyYearlyCountings.Models.CalYear", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Year")
.HasColumnType("INTEGER");
b.Property<string>("YearComment")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("CalYears");
});
modelBuilder.Entity("MyYearlyCountings.Models.Member", b => modelBuilder.Entity("MyYearlyCountings.Models.Member", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")