-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add sql server * add migrations for MSSQL Provider --------- Co-authored-by: Mukesh Murugan <31455818+iammukeshm@users.noreply.github.com>
- Loading branch information
1 parent
7f35d36
commit 6fa4abd
Showing
21 changed files
with
1,581 additions
and
0 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
73 changes: 73 additions & 0 deletions
73
api/migrations/MSSQL/Catalog/20240605195930_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.
46 changes: 46 additions & 0 deletions
46
api/migrations/MSSQL/Catalog/20240605195930_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,46 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace FSH.WebApi.Migrations.MSSQL.Catalog | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddCatalogSchema : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.EnsureSchema( | ||
name: "catalog"); | ||
|
||
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), | ||
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) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Products", x => x.Id); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Products", | ||
schema: "catalog"); | ||
} | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
api/migrations/MSSQL/Catalog/CatalogDbContextModelSnapshot.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,70 @@ | ||
// <auto-generated /> | ||
using System; | ||
using FSH.WebApi.Catalog.Infrastructure.Persistence; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
|
||
#nullable disable | ||
|
||
namespace FSH.WebApi.Migrations.MSSQL.Catalog | ||
{ | ||
[DbContext(typeof(CatalogDbContext))] | ||
partial class CatalogDbContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder | ||
.HasDefaultSchema("catalog") | ||
.HasAnnotation("ProductVersion", "8.0.6") | ||
.HasAnnotation("Relational:MaxIdentifierLength", 128); | ||
|
||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); | ||
|
||
modelBuilder.Entity("FSH.WebApi.Catalog.Domain.Product", b => | ||
{ | ||
b.Property<Guid>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("uniqueidentifier"); | ||
b.Property<DateTimeOffset>("Created") | ||
.HasColumnType("datetimeoffset"); | ||
b.Property<Guid>("CreatedBy") | ||
.HasColumnType("uniqueidentifier"); | ||
b.Property<string>("Description") | ||
.HasMaxLength(1000) | ||
.HasColumnType("nvarchar(1000)"); | ||
b.Property<DateTimeOffset>("LastModified") | ||
.HasColumnType("datetimeoffset"); | ||
b.Property<Guid?>("LastModifiedBy") | ||
.HasColumnType("uniqueidentifier"); | ||
b.Property<string>("Name") | ||
.IsRequired() | ||
.HasMaxLength(100) | ||
.HasColumnType("nvarchar(100)"); | ||
b.Property<decimal>("Price") | ||
.HasColumnType("decimal(18,2)"); | ||
b.Property<string>("TenantId") | ||
.IsRequired() | ||
.HasMaxLength(64) | ||
.HasColumnType("nvarchar(64)"); | ||
b.HasKey("Id"); | ||
b.ToTable("Products", "catalog"); | ||
b.HasAnnotation("Finbuckle:MultiTenant", true); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
Oops, something went wrong.