-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a07827b
commit e59bd3c
Showing
8 changed files
with
69 additions
and
95 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
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
39 changes: 19 additions & 20 deletions
39
...getting-started/uwp/sample/EFGetStarted.UWP/Migrations/20150729201928_MyFirstMigration.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 |
---|---|---|
@@ -1,51 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.Data.Entity.Migrations; | ||
using Microsoft.Data.Entity.Migrations.Builders; | ||
using Microsoft.Data.Entity.Migrations.Operations; | ||
|
||
namespace EFGetStartedUWPMigrations | ||
namespace EFGetStarted.UWP.Migrations | ||
{ | ||
public partial class MyFirstMigration : Migration | ||
{ | ||
public override void Up(MigrationBuilder migration) | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migration.CreateTable( | ||
migrationBuilder.CreateTable( | ||
name: "Blog", | ||
columns: table => new | ||
{ | ||
BlogId = table.Column(type: "INTEGER", nullable: false), // <- Add this comma | ||
//.Annotation("Sqlite:Autoincrement", "true"), // <- Remove or comment this line | ||
Url = table.Column(type: "TEXT", nullable: false) | ||
BlogId = table.Column<int>(nullable: false) | ||
.Annotation("Sqlite:Autoincrement", true), | ||
Url = table.Column<string>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Blog", x => x.BlogId); | ||
}); | ||
migration.CreateTable( | ||
migrationBuilder.CreateTable( | ||
name: "Post", | ||
columns: table => new | ||
{ | ||
PostId = table.Column(type: "INTEGER", nullable: false), // <- Add this comma | ||
//.Annotation("Sqlite:Autoincrement", "true"), // <- Remove or comment this line | ||
BlogId = table.Column(type: "INTEGER", nullable: false), | ||
Content = table.Column(type: "TEXT", nullable: true), | ||
Title = table.Column(type: "TEXT", nullable: true) | ||
PostId = table.Column<int>(nullable: false) | ||
.Annotation("Sqlite:Autoincrement", true), | ||
BlogId = table.Column<int>(nullable: false), | ||
Content = table.Column<string>(nullable: true), | ||
Title = table.Column<string>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Post", x => x.PostId); | ||
table.ForeignKey( | ||
name: "FK_Post_Blog_BlogId", | ||
columns: x => x.BlogId, | ||
referencedTable: "Blog", | ||
referencedColumn: "BlogId"); | ||
column: x => x.BlogId, | ||
principalTable: "Blog", | ||
principalColumn: "BlogId"); | ||
}); | ||
} | ||
|
||
public override void Down(MigrationBuilder migration) | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migration.DropTable("Post"); | ||
migration.DropTable("Blog"); | ||
migrationBuilder.DropTable("Post"); | ||
migrationBuilder.DropTable("Blog"); | ||
} | ||
} | ||
} |
40 changes: 16 additions & 24 deletions
40
...tarted/uwp/sample/EFGetStarted.UWP/Migrations/20150729201928_MyFirstMigration.designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
5 changes: 2 additions & 3 deletions
5
docs/getting-started/uwp/sample/EFGetStarted.UWP/project.json
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