Skip to content

Commit 8b4e997

Browse files
🗃️ Add initial migration
1 parent 4d965d1 commit 8b4e997

File tree

3 files changed

+142
-0
lines changed

3 files changed

+142
-0
lines changed

sample/EntityFrameworkCore.DataEncryption.Sample/Migrations/20220514214104_Initial.Designer.cs

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
3+
4+
#nullable disable
5+
6+
namespace EntityFrameworkCore.DataEncryption.Sample.Migrations
7+
{
8+
public partial class Initial : Migration
9+
{
10+
protected override void Up(MigrationBuilder migrationBuilder)
11+
{
12+
migrationBuilder.CreateTable(
13+
name: "Authors",
14+
columns: table => new
15+
{
16+
Id = table.Column<int>(type: "integer", nullable: false)
17+
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
18+
Name = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
19+
Surname = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
20+
Phone = table.Column<string>(type: "text", nullable: false)
21+
},
22+
constraints: table =>
23+
{
24+
table.PrimaryKey("PK_Authors", x => x.Id);
25+
});
26+
}
27+
28+
protected override void Down(MigrationBuilder migrationBuilder)
29+
{
30+
migrationBuilder.DropTable(
31+
name: "Authors");
32+
}
33+
}
34+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// <auto-generated />
2+
using EntityFrameworkCore.DataEncryption.Sample.Context;
3+
using Microsoft.EntityFrameworkCore;
4+
using Microsoft.EntityFrameworkCore.Infrastructure;
5+
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
7+
8+
#nullable disable
9+
10+
namespace EntityFrameworkCore.DataEncryption.Sample.Migrations
11+
{
12+
[DbContext(typeof(SampleDbContext))]
13+
partial class SampleDbContextModelSnapshot : ModelSnapshot
14+
{
15+
protected override void BuildModel(ModelBuilder modelBuilder)
16+
{
17+
#pragma warning disable 612, 618
18+
modelBuilder
19+
.HasAnnotation("ProductVersion", "6.0.4")
20+
.HasAnnotation("Relational:MaxIdentifierLength", 63);
21+
22+
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
23+
24+
modelBuilder.Entity("EntityFrameworkCore.DataEncryption.Sample.Entities.Author", b =>
25+
{
26+
b.Property<int>("Id")
27+
.ValueGeneratedOnAdd()
28+
.HasColumnType("integer");
29+
30+
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
31+
32+
b.Property<string>("Name")
33+
.IsRequired()
34+
.HasMaxLength(2048)
35+
.HasColumnType("character varying(2048)");
36+
37+
b.Property<string>("Phone")
38+
.IsRequired()
39+
.HasColumnType("text");
40+
41+
b.Property<string>("Surname")
42+
.IsRequired()
43+
.HasMaxLength(2048)
44+
.HasColumnType("character varying(2048)");
45+
46+
b.HasKey("Id");
47+
48+
b.ToTable("Authors");
49+
});
50+
#pragma warning restore 612, 618
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)