From 1a96616699ab41bf6343bc1acc45a836c3e6caf3 Mon Sep 17 00:00:00 2001 From: Paweł Bernaciak Date: Fri, 22 Dec 2023 16:02:41 +0100 Subject: Backup --- .../Migrations/20230209093124_initial.Designer.cs | 42 ---------------- CoreWiki/Migrations/20230209093124_initial.cs | 35 ------------- .../Migrations/20231222134125_Initial.Designer.cs | 57 ++++++++++++++++++++++ CoreWiki/Migrations/20231222134125_Initial.cs | 41 ++++++++++++++++ .../ApplicationDbContextModelSnapshot.cs | 21 ++++++-- 5 files changed, 116 insertions(+), 80 deletions(-) delete mode 100644 CoreWiki/Migrations/20230209093124_initial.Designer.cs delete mode 100644 CoreWiki/Migrations/20230209093124_initial.cs create mode 100644 CoreWiki/Migrations/20231222134125_Initial.Designer.cs create mode 100644 CoreWiki/Migrations/20231222134125_Initial.cs (limited to 'CoreWiki/Migrations') diff --git a/CoreWiki/Migrations/20230209093124_initial.Designer.cs b/CoreWiki/Migrations/20230209093124_initial.Designer.cs deleted file mode 100644 index 11af7b7..0000000 --- a/CoreWiki/Migrations/20230209093124_initial.Designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -using System; -using CoreWiki.Models; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace CoreWiki.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20230209093124_initial")] - partial class initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); - - modelBuilder.Entity("CoreWiki.Models.Article", b => - { - b.Property("Topic") - .HasColumnType("TEXT"); - - b.Property("Content") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Published") - .HasColumnType("TEXT"); - - b.HasKey("Topic"); - - b.ToTable("Articles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/CoreWiki/Migrations/20230209093124_initial.cs b/CoreWiki/Migrations/20230209093124_initial.cs deleted file mode 100644 index 84a7453..0000000 --- a/CoreWiki/Migrations/20230209093124_initial.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace CoreWiki.Migrations -{ - /// - public partial class initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Articles", - columns: table => new - { - Topic = table.Column(type: "TEXT", nullable: false), - Published = table.Column(type: "TEXT", nullable: false), - Content = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Articles", x => x.Topic); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Articles"); - } - } -} diff --git a/CoreWiki/Migrations/20231222134125_Initial.Designer.cs b/CoreWiki/Migrations/20231222134125_Initial.Designer.cs new file mode 100644 index 0000000..8c6556e --- /dev/null +++ b/CoreWiki/Migrations/20231222134125_Initial.Designer.cs @@ -0,0 +1,57 @@ +// +using System; +using CoreWiki.Models; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace CoreWiki.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20231222134125_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("CoreWiki.Models.Article", b => + { + b.Property("Slug") + .HasColumnType("TEXT"); + + b.Property("Content") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PublishedDateTime") + .HasColumnType("TEXT") + .HasColumnName("Published"); + + b.Property("Topic") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Slug"); + + b.ToTable("Articles"); + + b.HasData( + new + { + Slug = "home-page", + Content = "Welcome to your new CoreWiki installation", + PublishedDateTime = new DateTime(2023, 12, 22, 13, 41, 24, 978, DateTimeKind.Utc).AddTicks(110), + Topic = "Home Page" + }); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/CoreWiki/Migrations/20231222134125_Initial.cs b/CoreWiki/Migrations/20231222134125_Initial.cs new file mode 100644 index 0000000..80c0c6e --- /dev/null +++ b/CoreWiki/Migrations/20231222134125_Initial.cs @@ -0,0 +1,41 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CoreWiki.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Articles", + columns: table => new + { + Slug = table.Column(type: "TEXT", nullable: false), + Topic = table.Column(type: "TEXT", maxLength: 100, nullable: false), + Published = table.Column(type: "TEXT", nullable: false), + Content = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Articles", x => x.Slug); + }); + + migrationBuilder.InsertData( + table: "Articles", + columns: new[] { "Slug", "Content", "Published", "Topic" }, + values: new object[] { "home-page", "Welcome to your new CoreWiki installation", new DateTime(2023, 12, 22, 13, 41, 24, 978, DateTimeKind.Utc).AddTicks(110), "Home Page" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Articles"); + } + } +} diff --git a/CoreWiki/Migrations/ApplicationDbContextModelSnapshot.cs b/CoreWiki/Migrations/ApplicationDbContextModelSnapshot.cs index fb063f5..4808c70 100644 --- a/CoreWiki/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/CoreWiki/Migrations/ApplicationDbContextModelSnapshot.cs @@ -19,19 +19,34 @@ namespace CoreWiki.Migrations modelBuilder.Entity("CoreWiki.Models.Article", b => { - b.Property("Topic") + b.Property("Slug") .HasColumnType("TEXT"); b.Property("Content") .IsRequired() .HasColumnType("TEXT"); - b.Property("Published") + b.Property("PublishedDateTime") + .HasColumnType("TEXT") + .HasColumnName("Published"); + + b.Property("Topic") + .IsRequired() + .HasMaxLength(100) .HasColumnType("TEXT"); - b.HasKey("Topic"); + b.HasKey("Slug"); b.ToTable("Articles"); + + b.HasData( + new + { + Slug = "home-page", + Content = "Welcome to your new CoreWiki installation", + PublishedDateTime = new DateTime(2023, 12, 22, 13, 41, 24, 978, DateTimeKind.Utc).AddTicks(110), + Topic = "Home Page" + }); }); #pragma warning restore 612, 618 } -- cgit v1.2.3