diff options
Diffstat (limited to 'CoreWiki/Migrations')
| -rw-r--r-- | CoreWiki/Migrations/20231222134125_Initial.Designer.cs (renamed from CoreWiki/Migrations/20230209093124_initial.Designer.cs) | 25 | ||||
| -rw-r--r-- | CoreWiki/Migrations/20231222134125_Initial.cs (renamed from CoreWiki/Migrations/20230209093124_initial.cs) | 12 | ||||
| -rw-r--r-- | CoreWiki/Migrations/ApplicationDbContextModelSnapshot.cs | 21 |
3 files changed, 47 insertions, 11 deletions
diff --git a/CoreWiki/Migrations/20230209093124_initial.Designer.cs b/CoreWiki/Migrations/20231222134125_Initial.Designer.cs index 11af7b7..8c6556e 100644 --- a/CoreWiki/Migrations/20230209093124_initial.Designer.cs +++ b/CoreWiki/Migrations/20231222134125_Initial.Designer.cs @@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace CoreWiki.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20230209093124_initial")] - partial class initial + [Migration("20231222134125_Initial")] + partial class Initial { /// <inheritdoc /> protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -22,19 +22,34 @@ namespace CoreWiki.Migrations modelBuilder.Entity("CoreWiki.Models.Article", b => { - b.Property<string>("Topic") + b.Property<string>("Slug") .HasColumnType("TEXT"); b.Property<string>("Content") .IsRequired() .HasColumnType("TEXT"); - b.Property<DateTime>("Published") + b.Property<DateTime>("PublishedDateTime") + .HasColumnType("TEXT") + .HasColumnName("Published"); + + b.Property<string>("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 } diff --git a/CoreWiki/Migrations/20230209093124_initial.cs b/CoreWiki/Migrations/20231222134125_Initial.cs index 84a7453..80c0c6e 100644 --- a/CoreWiki/Migrations/20230209093124_initial.cs +++ b/CoreWiki/Migrations/20231222134125_Initial.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace CoreWiki.Migrations { /// <inheritdoc /> - public partial class initial : Migration + public partial class Initial : Migration { /// <inheritdoc /> protected override void Up(MigrationBuilder migrationBuilder) @@ -15,14 +15,20 @@ namespace CoreWiki.Migrations name: "Articles", columns: table => new { - Topic = table.Column<string>(type: "TEXT", nullable: false), + Slug = table.Column<string>(type: "TEXT", nullable: false), + Topic = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false), Published = table.Column<DateTime>(type: "TEXT", nullable: false), Content = table.Column<string>(type: "TEXT", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Articles", x => x.Topic); + 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" }); } /// <inheritdoc /> 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<string>("Topic") + b.Property<string>("Slug") .HasColumnType("TEXT"); b.Property<string>("Content") .IsRequired() .HasColumnType("TEXT"); - b.Property<DateTime>("Published") + b.Property<DateTime>("PublishedDateTime") + .HasColumnType("TEXT") + .HasColumnName("Published"); + + b.Property<string>("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 } |
