From 1089f31c1a6212b04f2103cc003fe602542b16f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Sun, 4 Jun 2023 23:46:34 +0200 Subject: [PATCH] Calender tables migration fixed --- .../20230604213025_CalenderTables.Designer.cs | 179 ++++++++++++++++++ .../20230604213025_CalenderTables.cs | 94 +++++++++ .../Migrations/DataContextModelSnapshot.cs | 98 ++++++++++ 3 files changed, 371 insertions(+) create mode 100644 MyYearlyCountings/Migrations/20230604213025_CalenderTables.Designer.cs create mode 100644 MyYearlyCountings/Migrations/20230604213025_CalenderTables.cs diff --git a/MyYearlyCountings/Migrations/20230604213025_CalenderTables.Designer.cs b/MyYearlyCountings/Migrations/20230604213025_CalenderTables.Designer.cs new file mode 100644 index 0000000..b09f48b --- /dev/null +++ b/MyYearlyCountings/Migrations/20230604213025_CalenderTables.Designer.cs @@ -0,0 +1,179 @@ +// +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 + { + /// + 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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Avisering") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Belopp") + .HasColumnType("REAL"); + + b.Property("BetalDatum") + .HasColumnType("TEXT"); + + b.Property("Konto") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Mottagare") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("AccountRecords"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalDay", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Day") + .HasColumnType("INTEGER"); + + b.Property("DayComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DayName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalDays"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalHour", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Day") + .HasColumnType("INTEGER"); + + b.Property("Hour") + .HasColumnType("INTEGER"); + + b.Property("HourComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalHours"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalMonth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("MonthComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("MonthName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalMonths"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalYear", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.Property("YearComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("CalYears"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.Member", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("NickName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PersonType") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Members"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/MyYearlyCountings/Migrations/20230604213025_CalenderTables.cs b/MyYearlyCountings/Migrations/20230604213025_CalenderTables.cs new file mode 100644 index 0000000..a27ae4e --- /dev/null +++ b/MyYearlyCountings/Migrations/20230604213025_CalenderTables.cs @@ -0,0 +1,94 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace MyYearlyCountings.Migrations +{ + /// + public partial class CalenderTables : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CalDays", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Year = table.Column(type: "INTEGER", nullable: false), + Month = table.Column(type: "INTEGER", nullable: false), + Day = table.Column(type: "INTEGER", nullable: false), + DayName = table.Column(type: "TEXT", nullable: false), + DayComment = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CalDays", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CalHours", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Year = table.Column(type: "INTEGER", nullable: false), + Month = table.Column(type: "INTEGER", nullable: false), + Day = table.Column(type: "INTEGER", nullable: false), + Hour = table.Column(type: "INTEGER", nullable: false), + HourComment = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CalHours", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CalMonths", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Year = table.Column(type: "INTEGER", nullable: false), + Month = table.Column(type: "INTEGER", nullable: false), + MonthName = table.Column(type: "TEXT", nullable: false), + MonthComment = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CalMonths", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CalYears", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Year = table.Column(type: "INTEGER", nullable: false), + YearComment = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CalYears", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CalDays"); + + migrationBuilder.DropTable( + name: "CalHours"); + + migrationBuilder.DropTable( + name: "CalMonths"); + + migrationBuilder.DropTable( + name: "CalYears"); + } + } +} diff --git a/MyYearlyCountings/Migrations/DataContextModelSnapshot.cs b/MyYearlyCountings/Migrations/DataContextModelSnapshot.cs index a025b71..0a5db6b 100644 --- a/MyYearlyCountings/Migrations/DataContextModelSnapshot.cs +++ b/MyYearlyCountings/Migrations/DataContextModelSnapshot.cs @@ -46,6 +46,104 @@ namespace MyYearlyCountings.Migrations b.ToTable("AccountRecords"); }); + modelBuilder.Entity("MyYearlyCountings.Models.CalDay", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Day") + .HasColumnType("INTEGER"); + + b.Property("DayComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DayName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalDays"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalHour", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Day") + .HasColumnType("INTEGER"); + + b.Property("Hour") + .HasColumnType("INTEGER"); + + b.Property("HourComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalHours"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalMonth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Month") + .HasColumnType("INTEGER"); + + b.Property("MonthComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("MonthName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CalMonths"); + }); + + modelBuilder.Entity("MyYearlyCountings.Models.CalYear", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Year") + .HasColumnType("INTEGER"); + + b.Property("YearComment") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("CalYears"); + }); + modelBuilder.Entity("MyYearlyCountings.Models.Member", b => { b.Property("Id")