Add project files.
This commit is contained in:
54
DiaryApp/Migrations/20260202130652_AddDiaryEntryTable.Designer.cs
generated
Normal file
54
DiaryApp/Migrations/20260202130652_AddDiaryEntryTable.Designer.cs
generated
Normal file
@ -0,0 +1,54 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DiaryApp.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DiaryApp.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20260202130652_AddDiaryEntryTable")]
|
||||
partial class AddDiaryEntryTable
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DiaryApp.Models.DiaryEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreated")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("DiaryEntries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
37
DiaryApp/Migrations/20260202130652_AddDiaryEntryTable.cs
Normal file
37
DiaryApp/Migrations/20260202130652_AddDiaryEntryTable.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DiaryApp.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddDiaryEntryTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DiaryEntries",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DateCreated = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DiaryEntries", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DiaryEntries");
|
||||
}
|
||||
}
|
||||
}
|
||||
84
DiaryApp/Migrations/20260202153708_AddedSeedingDataDiaryEntries.Designer.cs
generated
Normal file
84
DiaryApp/Migrations/20260202153708_AddedSeedingDataDiaryEntries.Designer.cs
generated
Normal file
@ -0,0 +1,84 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DiaryApp.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DiaryApp.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20260202153708_AddedSeedingDataDiaryEntries")]
|
||||
partial class AddedSeedingDataDiaryEntries
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DiaryApp.Models.DiaryEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreated")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("DiaryEntries");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Content = "Went hiking with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 1, 10, 32, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Hiking"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Content = "Went Shoping with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 10, 8, 32, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Shoping"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Content = "Went Swimming with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 15, 15, 42, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Swimming"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Content = "Went Biking with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 17, 12, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Biking"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace DiaryApp.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddedSeedingDataDiaryEntries : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "DiaryEntries",
|
||||
columns: new[] { "Id", "Content", "DateCreated", "Title" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Went hiking with Joe!", new DateTime(2026, 1, 1, 10, 32, 0, 0, DateTimeKind.Unspecified), "Went Hiking" },
|
||||
{ 2, "Went Shoping with Joe!", new DateTime(2026, 1, 10, 8, 32, 0, 0, DateTimeKind.Unspecified), "Went Shoping" },
|
||||
{ 3, "Went Swimming with Joe!", new DateTime(2026, 1, 15, 15, 42, 0, 0, DateTimeKind.Unspecified), "Went Swimming" },
|
||||
{ 4, "Went Biking with Joe!", new DateTime(2026, 1, 17, 12, 0, 0, 0, DateTimeKind.Unspecified), "Went Biking" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "DiaryEntries",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "DiaryEntries",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "DiaryEntries",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "DiaryEntries",
|
||||
keyColumn: "Id",
|
||||
keyValue: 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
81
DiaryApp/Migrations/ApplicationDbContextModelSnapshot.cs
Normal file
81
DiaryApp/Migrations/ApplicationDbContextModelSnapshot.cs
Normal file
@ -0,0 +1,81 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DiaryApp.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DiaryApp.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DiaryApp.Models.DiaryEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreated")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("DiaryEntries");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Content = "Went hiking with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 1, 10, 32, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Hiking"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Content = "Went Shoping with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 10, 8, 32, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Shoping"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Content = "Went Swimming with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 15, 15, 42, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Swimming"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Content = "Went Biking with Joe!",
|
||||
DateCreated = new DateTime(2026, 1, 17, 12, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
Title = "Went Biking"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user