-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
5902fad
commit d28a00c
Showing
34 changed files
with
457 additions
and
962 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
73 changes: 0 additions & 73 deletions
73
src/api/migrations/MSSQL/Catalog/20240605195930_Add Catalog Schema.Designer.cs
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
src/api/migrations/MSSQL/Catalog/20240605195930_Add Catalog Schema.cs
This file was deleted.
Oops, something went wrong.
138 changes: 138 additions & 0 deletions
138
src/api/migrations/MSSQL/Catalog/20241123030623_Add Catalog Schema.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
src/api/migrations/MSSQL/Catalog/20241123030623_Add Catalog Schema.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,86 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace FSH.Starter.WebApi.Migrations.MSSQL.Catalog | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddCatalogSchema : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.EnsureSchema( | ||
name: "catalog"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Brands", | ||
schema: "catalog", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | ||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), | ||
TenantId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), | ||
Created = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
LastModified = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
LastModifiedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | ||
Deleted = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Brands", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Products", | ||
schema: "catalog", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), | ||
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true), | ||
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false), | ||
BrandId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | ||
TenantId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), | ||
Created = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
LastModified = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
LastModifiedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | ||
Deleted = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Products", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_Products_Brands_BrandId", | ||
column: x => x.BrandId, | ||
principalSchema: "catalog", | ||
principalTable: "Brands", | ||
principalColumn: "Id"); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Products_BrandId", | ||
schema: "catalog", | ||
table: "Products", | ||
column: "BrandId"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Products", | ||
schema: "catalog"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "Brands", | ||
schema: "catalog"); | ||
} | ||
} | ||
} |
Oops, something went wrong.