forked from omaxel/SimplePatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DateTime and Guid fileds in example projects. Added migrations in example projects.
- Loading branch information
Showing
24 changed files
with
651 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ch.Examples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914140401_Init.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
...SimplePatch.Examples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914140401_Init.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
namespace SimplePatch.Examples.Core.DAL.Migrations | ||
{ | ||
public partial class Init : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "People", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(nullable: false) | ||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||
Age = table.Column<int>(nullable: false), | ||
Name = table.Column<string>(nullable: false), | ||
Surname = table.Column<string>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_People", x => x.Id); | ||
}); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "People"); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...amples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914142601_BirthDate.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...ePatch.Examples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914142601_BirthDate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace SimplePatch.Examples.Core.DAL.Migrations | ||
{ | ||
public partial class BirthDate : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<DateTime>( | ||
name: "BirthDate", | ||
table: "People", | ||
nullable: true); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "BirthDate", | ||
table: "People"); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...xamples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914142632_GlobalId.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...lePatch.Examples.Core/SimplePatch.Examples.Core.DAL/Migrations/20170914142632_GlobalId.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace SimplePatch.Examples.Core.DAL.Migrations | ||
{ | ||
public partial class GlobalId : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<Guid>( | ||
name: "GlobalId", | ||
table: "People", | ||
nullable: true); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "GlobalId", | ||
table: "People"); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...Patch.Examples.Core/SimplePatch.Examples.Core.DAL/Migrations/AppDbContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using SimplePatch.Examples.Core.DAL; | ||
|
||
namespace SimplePatch.Examples.Core.DAL.Migrations | ||
{ | ||
[DbContext(typeof(AppDbContext))] | ||
partial class AppDbContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "1.1.2") | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
modelBuilder.Entity("SimplePatch.Examples.Core.DAL.Person", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd(); | ||
|
||
b.Property<int>("Age"); | ||
|
||
b.Property<DateTime?>("BirthDate"); | ||
|
||
b.Property<Guid?>("GlobalId"); | ||
|
||
b.Property<string>("Name") | ||
.IsRequired(); | ||
|
||
b.Property<string>("Surname") | ||
.IsRequired(); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.ToTable("People"); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...FullNET/SimplePatch.Examples.FullNET.DAL/Migrations/201709141340179_BirthDate.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...Examples.FullNET/SimplePatch.Examples.FullNET.DAL/Migrations/201709141340179_BirthDate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace SimplePatch.Examples.FullNET.DAL.Migrations | ||
{ | ||
using System; | ||
using System.Data.Entity.Migrations; | ||
|
||
public partial class BirthDate : DbMigration | ||
{ | ||
public override void Up() | ||
{ | ||
AddColumn("dbo.People", "BirthDate", c => c.DateTime()); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
DropColumn("dbo.People", "BirthDate"); | ||
} | ||
} | ||
} |
Oops, something went wrong.