-
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.
Merge pull request #9 from Intrepiware/add-login
Add login, favorites, copy link
- Loading branch information
Showing
34 changed files
with
1,715 additions
and
116 deletions.
There are no files selected for viewing
267 changes: 267 additions & 0 deletions
267
WorkoutBuilder.Data/Migrations/20231225161038_Add-WorkoutTable.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
WorkoutBuilder.Data/Migrations/20231225161038_Add-WorkoutTable.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,60 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace WorkoutBuilder.Data.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddWorkoutTable : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Workout", | ||
schema: "workouts", | ||
columns: table => new | ||
{ | ||
Id = table.Column<long>(type: "bigint", nullable: false) | ||
.Annotation("SqlServer:Identity", "1, 1"), | ||
PublicId = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false), | ||
UserId = table.Column<long>(type: "bigint", nullable: true), | ||
CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false), | ||
Body = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
IsFavorite = table.Column<bool>(type: "bit", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Workout", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_Workout_User_UserId", | ||
column: x => x.UserId, | ||
principalSchema: "workouts", | ||
principalTable: "User", | ||
principalColumn: "Id"); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Workout_PublicId", | ||
schema: "workouts", | ||
table: "Workout", | ||
column: "PublicId", | ||
unique: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Workout_UserId", | ||
schema: "workouts", | ||
table: "Workout", | ||
column: "UserId"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Workout", | ||
schema: "workouts"); | ||
} | ||
} | ||
} |
Oops, something went wrong.