This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
26 changed files
with
310 additions
and
124 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
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
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,8 @@ | ||
namespace Spectre.Query.Example.Data | ||
{ | ||
public sealed class Genre | ||
{ | ||
public int GenreId { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
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
33 changes: 0 additions & 33 deletions
33
examples/Spectre.Query.Example/Migrations/20180807234311_InitialMigration.cs
This file was deleted.
Oops, something went wrong.
27 changes: 26 additions & 1 deletion
27
...180807234311_InitialMigration.Designer.cs → ...180820154456_InitialMigration.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
examples/Spectre.Query.Example/Migrations/20180820154456_InitialMigration.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,61 @@ | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace Spectre.Query.Example.Migrations | ||
{ | ||
public partial class InitialMigration : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Genres", | ||
columns: table => new | ||
{ | ||
GenreId = table.Column<int>(nullable: false) | ||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||
Name = table.Column<string>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Genres", x => x.GenreId); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Movies", | ||
columns: table => new | ||
{ | ||
MovieId = table.Column<int>(nullable: false) | ||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||
Name = table.Column<string>(nullable: true), | ||
ReleasedAt = table.Column<int>(nullable: false), | ||
Rating = table.Column<int>(nullable: false), | ||
Seen = table.Column<bool>(nullable: false), | ||
GenreId = table.Column<int>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Movies", x => x.MovieId); | ||
table.ForeignKey( | ||
name: "FK_Movies_Genres_GenreId", | ||
column: x => x.GenreId, | ||
principalTable: "Genres", | ||
principalColumn: "GenreId", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Movies_GenreId", | ||
table: "Movies", | ||
column: "GenreId"); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Movies"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "Genres"); | ||
} | ||
} | ||
} |
Oops, something went wrong.