Skip to content

Commit

Permalink
Merge pull request #6 from abdulrahmannadap/New-Update
Browse files Browse the repository at this point in the history
New update
  • Loading branch information
abdulrahmannadap authored Mar 6, 2024
2 parents 6f10faa + b074893 commit 039b7da
Show file tree
Hide file tree
Showing 34 changed files with 1,238 additions and 1,292 deletions.

This file was deleted.

34 changes: 0 additions & 34 deletions FCommerce.DataAcsess/Migrations/20240211153104_InitialCreate.cs

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions FCommerce.DataAcsess/Migrations/20240214093034_AddProductModel.cs

This file was deleted.

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

64 changes: 64 additions & 0 deletions FCommerce.DataAcsess/Migrations/20240304122601_InitialCreate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace FCommerce.DataAcsess.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.Id);
});

migrationBuilder.CreateTable(
name: "Products",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ProductName = table.Column<string>(type: "nvarchar(max)", nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
ProductPrice = table.Column<double>(type: "float", nullable: false),
CategoryId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.Id);
table.ForeignKey(
name: "FK_Products_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateIndex(
name: "IX_Products_CategoryId",
table: "Products",
column: "CategoryId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Products");

migrationBuilder.DropTable(
name: "Categories");
}
}
}

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

Loading

0 comments on commit 039b7da

Please sign in to comment.