Skip to content

Commit 5d71b85

Browse files
committed
chore(db): add initial migrations
1 parent dcd0e38 commit 5d71b85

File tree

3 files changed

+154
-0
lines changed

3 files changed

+154
-0
lines changed

Micro.AppRegistration.Api/Migrations/20201123172026_InitialCreate.Designer.cs

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
namespace Micro.AppRegistration.Api.Migrations
5+
{
6+
public partial class InitialCreate : Migration
7+
{
8+
protected override void Up(MigrationBuilder migrationBuilder)
9+
{
10+
migrationBuilder.CreateTable(
11+
name: "Applications",
12+
columns: table => new
13+
{
14+
Id = table.Column<string>(nullable: false),
15+
Name = table.Column<string>(nullable: true),
16+
User = table.Column<string>(nullable: true),
17+
Secret = table.Column<string>(nullable: true),
18+
ShortCode = table.Column<string>(nullable: true),
19+
UseDefaultCode = table.Column<bool>(nullable: false),
20+
Approved = table.Column<bool>(nullable: false),
21+
CreatedAt = table.Column<DateTime>(nullable: false),
22+
CreatedBy = table.Column<string>(nullable: true)
23+
},
24+
constraints: table =>
25+
{
26+
table.PrimaryKey("PK_Applications", x => x.Id);
27+
});
28+
}
29+
30+
protected override void Down(MigrationBuilder migrationBuilder)
31+
{
32+
migrationBuilder.DropTable(
33+
name: "Applications");
34+
}
35+
}
36+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// <auto-generated />
2+
using System;
3+
using Micro.AppRegistration.Api.Models;
4+
using Microsoft.EntityFrameworkCore;
5+
using Microsoft.EntityFrameworkCore.Infrastructure;
6+
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
8+
9+
namespace Micro.AppRegistration.Api.Migrations
10+
{
11+
[DbContext(typeof(ApplicationContext))]
12+
partial class ApplicationContextModelSnapshot : ModelSnapshot
13+
{
14+
protected override void BuildModel(ModelBuilder modelBuilder)
15+
{
16+
#pragma warning disable 612, 618
17+
modelBuilder
18+
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
19+
.HasAnnotation("ProductVersion", "3.0.0-preview8.19405.11")
20+
.HasAnnotation("Relational:MaxIdentifierLength", 63);
21+
22+
modelBuilder.Entity("Micro.AppRegistration.Api.Models.Application", b =>
23+
{
24+
b.Property<string>("Id")
25+
.HasColumnType("text");
26+
27+
b.Property<bool>("Approved")
28+
.HasColumnType("boolean");
29+
30+
b.Property<DateTime>("CreatedAt")
31+
.HasColumnType("timestamp without time zone");
32+
33+
b.Property<string>("CreatedBy")
34+
.HasColumnType("text");
35+
36+
b.Property<string>("Name")
37+
.HasColumnType("text");
38+
39+
b.Property<string>("Secret")
40+
.HasColumnType("text");
41+
42+
b.Property<string>("ShortCode")
43+
.HasColumnType("text");
44+
45+
b.Property<bool>("UseDefaultCode")
46+
.HasColumnType("boolean");
47+
48+
b.Property<string>("User")
49+
.HasColumnType("text");
50+
51+
b.HasKey("Id");
52+
53+
b.ToTable("Applications");
54+
});
55+
#pragma warning restore 612, 618
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)