Skip to content

Commit

Permalink
Merge pull request #9 from Intrepiware/add-login
Browse files Browse the repository at this point in the history
Add login, favorites, copy link
  • Loading branch information
Intrepiware authored Dec 30, 2023
2 parents 0d7f0f0 + 7258d4d commit b345691
Show file tree
Hide file tree
Showing 34 changed files with 1,715 additions and 116 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions WorkoutBuilder.Data/Migrations/20231225161038_Add-WorkoutTable.cs
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");
}
}
}
Loading

0 comments on commit b345691

Please sign in to comment.