forked from tsai/eShopOnAbp
12 changed files with 509 additions and 97 deletions
@ -0,0 +1,208 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using EShopOnAbp.OrderingService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.OrderingService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(OrderingServiceDbContext))] |
||||
|
[Migration("20220119084330_Npgsql_Time")] |
||||
|
partial class Npgsql_Time |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) |
||||
|
.HasAnnotation("ProductVersion", "6.0.0") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63); |
||||
|
|
||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.Order", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("character varying(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("text") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<DateTime>("OrderDate") |
||||
|
.HasColumnType("timestamp without time zone"); |
||||
|
|
||||
|
b.Property<int>("OrderNo") |
||||
|
.HasColumnType("integer"); |
||||
|
|
||||
|
b.Property<string>("PaymentMethod") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("character varying(128)"); |
||||
|
|
||||
|
b.Property<Guid?>("PaymentRequestId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("PaymentStatus") |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("character varying(256)"); |
||||
|
|
||||
|
b.Property<int>("_orderStatusId") |
||||
|
.HasColumnType("integer") |
||||
|
.HasColumnName("OrderStatusId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("_orderStatusId"); |
||||
|
|
||||
|
b.ToTable("Orders", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.OrderItem", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<decimal>("Discount") |
||||
|
.HasColumnType("numeric"); |
||||
|
|
||||
|
b.Property<Guid>("OrderId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("PictureUrl") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<string>("ProductCode") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<Guid>("ProductId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("ProductName") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<decimal>("UnitPrice") |
||||
|
.HasColumnType("numeric"); |
||||
|
|
||||
|
b.Property<int>("Units") |
||||
|
.HasColumnType("integer"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("OrderId"); |
||||
|
|
||||
|
b.ToTable("OrderItems", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.OrderStatus", b => |
||||
|
{ |
||||
|
b.Property<int>("Id") |
||||
|
.HasColumnType("integer") |
||||
|
.HasDefaultValue(1); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("character varying(256)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("OrderStatus", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.Order", b => |
||||
|
{ |
||||
|
b.HasOne("EShopOnAbp.OrderingService.Orders.OrderStatus", "OrderStatus") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("_orderStatusId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
|
||||
|
b.OwnsOne("EShopOnAbp.OrderingService.Orders.Address", "Address", b1 => |
||||
|
{ |
||||
|
b1.Property<Guid>("OrderId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b1.Property<string>("City") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.Property<string>("Country") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.Property<string>("Description") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.Property<string>("Street") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.Property<string>("ZipCode") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.HasKey("OrderId"); |
||||
|
|
||||
|
b1.ToTable("Orders"); |
||||
|
|
||||
|
b1.WithOwner() |
||||
|
.HasForeignKey("OrderId"); |
||||
|
}); |
||||
|
|
||||
|
b.OwnsOne("EShopOnAbp.OrderingService.Orders.Buyer", "Buyer", b1 => |
||||
|
{ |
||||
|
b1.Property<Guid>("OrderId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b1.Property<string>("Email") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.Property<Guid?>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b1.Property<string>("Name") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b1.HasKey("OrderId"); |
||||
|
|
||||
|
b1.ToTable("Orders"); |
||||
|
|
||||
|
b1.WithOwner() |
||||
|
.HasForeignKey("OrderId"); |
||||
|
}); |
||||
|
|
||||
|
b.Navigation("Address"); |
||||
|
|
||||
|
b.Navigation("Buyer"); |
||||
|
|
||||
|
b.Navigation("OrderStatus"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.OrderItem", b => |
||||
|
{ |
||||
|
b.HasOne("EShopOnAbp.OrderingService.Orders.Order", null) |
||||
|
.WithMany("OrderItems") |
||||
|
.HasForeignKey("OrderId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.OrderingService.Orders.Order", b => |
||||
|
{ |
||||
|
b.Navigation("OrderItems"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.OrderingService.Migrations |
||||
|
{ |
||||
|
public partial class Npgsql_Time : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "OrderDate", |
||||
|
table: "Orders", |
||||
|
type: "timestamp without time zone", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "timestamp with time zone"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "OrderDate", |
||||
|
table: "Orders", |
||||
|
type: "timestamp with time zone", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "timestamp without time zone"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,140 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using EShopOnAbp.PaymentService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.PaymentService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(PaymentServiceDbContext))] |
||||
|
[Migration("20220119084346_Npgsql_Time")] |
||||
|
partial class Npgsql_Time |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) |
||||
|
.HasAnnotation("ProductVersion", "6.0.0") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63); |
||||
|
|
||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.PaymentService.PaymentRequests.PaymentRequest", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("BuyerId") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("character varying(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("timestamp without time zone") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uuid") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("Currency") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(3) |
||||
|
.HasColumnType("character varying(3)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("text") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("FailReason") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("boolean") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<string>("OrderId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(36) |
||||
|
.HasColumnType("character varying(36)"); |
||||
|
|
||||
|
b.Property<int>("OrderNo") |
||||
|
.HasColumnType("integer"); |
||||
|
|
||||
|
b.Property<int>("State") |
||||
|
.HasColumnType("integer"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("OrderId"); |
||||
|
|
||||
|
b.ToTable("PaymentRequests"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.PaymentService.PaymentRequests.PaymentRequestProduct", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<string>("Code") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(32) |
||||
|
.HasColumnType("character varying(32)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("character varying(256)"); |
||||
|
|
||||
|
b.Property<Guid>("PaymentRequestId") |
||||
|
.HasColumnType("uuid"); |
||||
|
|
||||
|
b.Property<int>("Quantity") |
||||
|
.HasColumnType("integer"); |
||||
|
|
||||
|
b.Property<string>("ReferenceId") |
||||
|
.HasColumnType("text"); |
||||
|
|
||||
|
b.Property<decimal>("TotalPrice") |
||||
|
.HasColumnType("numeric"); |
||||
|
|
||||
|
b.Property<decimal>("UnitPrice") |
||||
|
.HasColumnType("numeric"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("PaymentRequestId"); |
||||
|
|
||||
|
b.ToTable("PaymentRequestProduct"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.PaymentService.PaymentRequests.PaymentRequestProduct", b => |
||||
|
{ |
||||
|
b.HasOne("EShopOnAbp.PaymentService.PaymentRequests.PaymentRequest", null) |
||||
|
.WithMany("Products") |
||||
|
.HasForeignKey("PaymentRequestId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("EShopOnAbp.PaymentService.PaymentRequests.PaymentRequest", b => |
||||
|
{ |
||||
|
b.Navigation("Products"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EShopOnAbp.PaymentService.Migrations |
||||
|
{ |
||||
|
public partial class Npgsql_Time : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "CreationTime", |
||||
|
table: "PaymentRequests", |
||||
|
type: "timestamp without time zone", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "timestamp with time zone"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "CreationTime", |
||||
|
table: "PaymentRequests", |
||||
|
type: "timestamp with time zone", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "timestamp without time zone"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue