Browse Source

SP_10062024_ColumnTypeChange

main
Soumen Pal 7 months ago
parent
commit
477245a731
26 changed files with 191 additions and 6506 deletions
  1. +3
    -3
      aspnet-core/src/Acme.BookStore.Application.Contracts/BookIssued/BookIssueDto.cs
  2. +3
    -3
      aspnet-core/src/Acme.BookStore.Application.Contracts/BookIssued/IBookIssueAppService.cs
  3. +1
    -1
      aspnet-core/src/Acme.BookStore.Application.Contracts/Customers/CustomerDto.cs
  4. +3
    -3
      aspnet-core/src/Acme.BookStore.Application.Contracts/Customers/ICustomerAppService.cs
  5. +3
    -3
      aspnet-core/src/Acme.BookStore.Application/BookIssued/BookIssueAppService.cs
  6. +3
    -3
      aspnet-core/src/Acme.BookStore.Application/Customers/CustomerAppService.cs
  7. +4
    -4
      aspnet-core/src/Acme.BookStore.Domain/BookIssued/BookIssue.cs
  8. +1
    -1
      aspnet-core/src/Acme.BookStore.Domain/BookIssued/BookIssueManager.cs
  9. +3
    -3
      aspnet-core/src/Acme.BookStore.Domain/BookIssued/IBookIssueRepository.cs
  10. +1
    -1
      aspnet-core/src/Acme.BookStore.Domain/BookStoreDataSeederContributor.cs
  11. +2
    -2
      aspnet-core/src/Acme.BookStore.Domain/Customers/Customer.cs
  12. +1
    -1
      aspnet-core/src/Acme.BookStore.Domain/Customers/CustomerManager.cs
  13. +2
    -2
      aspnet-core/src/Acme.BookStore.Domain/Customers/ICustomerRepository.cs
  14. +11
    -11
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/BookIssued/EfCoreBookIssueRepository.cs
  15. +7
    -7
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Customers/EfCoreCustomerRepository.cs
  16. +1
    -1
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs
  17. +0
    -2011
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605054852_Created_Book_Entity.Designer.cs
  18. +0
    -43
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605054852_Created_Book_Entity.cs
  19. +0
    -2077
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605111342_Added_Authors.Designer.cs
  20. +0
    -50
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605111342_Added_Authors.cs
  21. +0
    -2151
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606070329_Added_Customers.Designer.cs
  22. +0
    -47
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606070329_Added_Customers.cs
  23. +0
    -50
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606100414_Added_BookIssued.cs
  24. +9
    -15
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240610170422_Change_Table_ColumnType.Designer.cs
  25. +126
    -0
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240610170422_Change_Table_ColumnType.cs
  26. +7
    -13
      aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs

+ 3
- 3
aspnet-core/src/Acme.BookStore.Application.Contracts/BookIssued/BookIssueDto.cs View File

@ -6,17 +6,17 @@ using Volo.Abp.Application.Dtos;
namespace Acme.BookStore.BookIssued namespace Acme.BookStore.BookIssued
{ {
public class BookIssueDto : EntityDto<int>
public class BookIssueDto : EntityDto<Guid>
{ {
[Required] [Required]
public Guid bookId { get; set; } public Guid bookId { get; set; }
[Required] [Required]
public int customerId { get; set; }
public Guid customerId { get; set; }
} }
public class BookIssueListDto public class BookIssueListDto
{ {
public int bookIssueId { get; set; }
public Guid bookIssueId { get; set; }
public string bookName { get; set; } public string bookName { get; set; }
public string customerName { get; set; } public string customerName { get; set; }
public DateTime issueDate { get; set; } public DateTime issueDate { get; set; }


+ 3
- 3
aspnet-core/src/Acme.BookStore.Application.Contracts/BookIssued/IBookIssueAppService.cs View File

@ -9,14 +9,14 @@ namespace Acme.BookStore.BookIssued
{ {
public interface IBookIssueAppService : IApplicationService public interface IBookIssueAppService : IApplicationService
{ {
Task<BookIssueDto> GetAsync(int id);
Task<BookIssueDto> GetAsync(Guid id);
Task<PagedResultDto<BookIssueListDto>> GetListAsync(); Task<PagedResultDto<BookIssueListDto>> GetListAsync();
Task<BookIssueDto> CreateAsync(BookIssueDto input); Task<BookIssueDto> CreateAsync(BookIssueDto input);
Task UpdateAsync(int id, BookIssueDto input);
Task UpdateAsync(Guid id, BookIssueDto input);
Task DeleteAsync(int id);
Task DeleteAsync(Guid id);
} }
} }

+ 1
- 1
aspnet-core/src/Acme.BookStore.Application.Contracts/Customers/CustomerDto.cs View File

@ -6,7 +6,7 @@ using Volo.Abp.Application.Dtos;
namespace Acme.BookStore.Customers namespace Acme.BookStore.Customers
{ {
public class CustomerDto : EntityDto<int>
public class CustomerDto : EntityDto<Guid>
{ {
[Required] [Required]
public string firstName { get; set; } public string firstName { get; set; }


+ 3
- 3
aspnet-core/src/Acme.BookStore.Application.Contracts/Customers/ICustomerAppService.cs View File

@ -10,15 +10,15 @@ namespace Acme.BookStore.Customers
{ {
public interface ICustomerAppService : IApplicationService public interface ICustomerAppService : IApplicationService
{ {
Task<CustomerDto> GetAsync(int id);
Task<CustomerDto> GetAsync(Guid id);
Task<PagedResultDto<CustomerDto>> GetListAsync(); Task<PagedResultDto<CustomerDto>> GetListAsync();
Task<CustomerDto> CreateAsync(CustomerDto input); Task<CustomerDto> CreateAsync(CustomerDto input);
Task UpdateAsync(int id, CustomerDto input);
Task UpdateAsync(Guid id, CustomerDto input);
Task DeleteAsync(int id);
Task DeleteAsync(Guid id);
Task<List<CustomerDto>> GetcustomerDropDown(); Task<List<CustomerDto>> GetcustomerDropDown();
} }
} }

+ 3
- 3
aspnet-core/src/Acme.BookStore.Application/BookIssued/BookIssueAppService.cs View File

@ -24,7 +24,7 @@ namespace Acme.BookStore.BookIssued
_bookIssueManager = bookIssueManager; _bookIssueManager = bookIssueManager;
} }
public async Task<BookIssueDto> GetAsync(int id)
public async Task<BookIssueDto> GetAsync(Guid id)
{ {
var cus = await _bookIssueRepository.GetAsync(id); var cus = await _bookIssueRepository.GetAsync(id);
return ObjectMapper.Map<BookIssue, BookIssueDto>(cus); return ObjectMapper.Map<BookIssue, BookIssueDto>(cus);
@ -55,7 +55,7 @@ namespace Acme.BookStore.BookIssued
} }
[Authorize(BookStorePermissions.BookIssued.Edit)] [Authorize(BookStorePermissions.BookIssued.Edit)]
public async Task UpdateAsync(int id, BookIssueDto input)
public async Task UpdateAsync(Guid id, BookIssueDto input)
{ {
var cus = await _bookIssueRepository.GetAsync(id); var cus = await _bookIssueRepository.GetAsync(id);
@ -64,7 +64,7 @@ namespace Acme.BookStore.BookIssued
[Authorize(BookStorePermissions.BookIssued.Delete)] [Authorize(BookStorePermissions.BookIssued.Delete)]
public async Task DeleteAsync(int id)
public async Task DeleteAsync(Guid id)
{ {
await _bookIssueRepository.DeleteAsync(id); await _bookIssueRepository.DeleteAsync(id);
} }


+ 3
- 3
aspnet-core/src/Acme.BookStore.Application/Customers/CustomerAppService.cs View File

@ -25,7 +25,7 @@ namespace Acme.BookStore.Customers
_customerManager = customerManager; _customerManager = customerManager;
} }
public async Task<CustomerDto> GetAsync(int id)
public async Task<CustomerDto> GetAsync(Guid id)
{ {
var cus = await _customerRepository.GetAsync(id); var cus = await _customerRepository.GetAsync(id);
return ObjectMapper.Map<Customer, CustomerDto>(cus); return ObjectMapper.Map<Customer, CustomerDto>(cus);
@ -63,7 +63,7 @@ namespace Acme.BookStore.Customers
[Authorize(BookStorePermissions.Customers.Edit)] [Authorize(BookStorePermissions.Customers.Edit)]
public async Task UpdateAsync(int id, CustomerDto input)
public async Task UpdateAsync(Guid id, CustomerDto input)
{ {
var cus = await _customerRepository.GetAsync(id); var cus = await _customerRepository.GetAsync(id);
@ -78,7 +78,7 @@ namespace Acme.BookStore.Customers
[Authorize(BookStorePermissions.Customers.Delete)] [Authorize(BookStorePermissions.Customers.Delete)]
public async Task DeleteAsync(int id)
public async Task DeleteAsync(Guid id)
{ {
await _customerRepository.DeleteAsync(id); await _customerRepository.DeleteAsync(id);
} }


+ 4
- 4
aspnet-core/src/Acme.BookStore.Domain/BookIssued/BookIssue.cs View File

@ -7,15 +7,15 @@ using Volo.Abp.Domain.Entities.Auditing;
namespace Acme.BookStore.BookIssued namespace Acme.BookStore.BookIssued
{ {
public class BookIssue : FullAuditedAggregateRoot<int>
public class BookIssue : FullAuditedAggregateRoot<Guid>
{ {
public Guid bookId { get; set; } public Guid bookId { get; set; }
public int customerId { get; set; }
public Guid customerId { get; set; }
private BookIssue() private BookIssue()
{ {
/* This constructor is for deserialization / ORM purpose */ /* This constructor is for deserialization / ORM purpose */
} }
internal BookIssue(int id, Guid bookId, int customerId) : base(id)
internal BookIssue(Guid id, Guid bookId, Guid customerId) : base(id)
{ {
this.bookId = bookId; this.bookId = bookId;
this.customerId = customerId; this.customerId = customerId;
@ -24,7 +24,7 @@ namespace Acme.BookStore.BookIssued
public class BookIssueList public class BookIssueList
{ {
public int bookIssueId { get; set; }
public Guid bookIssueId { get; set; }
public string bookName { get; set; } public string bookName { get; set; }
public string customerName { get; set; } public string customerName { get; set; }
public DateTime issueDate { get; set; } public DateTime issueDate { get; set; }


+ 1
- 1
aspnet-core/src/Acme.BookStore.Domain/BookIssued/BookIssueManager.cs View File

@ -26,7 +26,7 @@ namespace Acme.BookStore.BookIssued
throw new BookIssueErrorException(existingBookIssue.customerName, existingBookIssue.bookName); throw new BookIssueErrorException(existingBookIssue.customerName, existingBookIssue.bookName);
} }
return new BookIssue( return new BookIssue(
await _bookIssueRepository.NewBookIssueId(),
GuidGenerator.Create(),
bookissue.bookId, bookissue.bookId,
bookissue.customerId bookissue.customerId
); );


+ 3
- 3
aspnet-core/src/Acme.BookStore.Domain/BookIssued/IBookIssueRepository.cs View File

@ -8,10 +8,10 @@ using Volo.Abp.Domain.Repositories;
namespace Acme.BookStore.BookIssued namespace Acme.BookStore.BookIssued
{ {
public interface IBookIssueRepository : IRepository<BookIssue, int>
public interface IBookIssueRepository : IRepository<BookIssue, Guid>
{ {
Task<BookIssueList> FindBookIssueCustomer(int customerId, Guid bookId);
Task<int> NewBookIssueId();
Task<BookIssueList> FindBookIssueCustomer(Guid customerId, Guid bookId);
//Task<int> NewBookIssueId();
Task<List<BookIssueList>> BookIssueList(); Task<List<BookIssueList>> BookIssueList();
} }
} }

+ 1
- 1
aspnet-core/src/Acme.BookStore.Domain/BookStoreDataSeederContributor.cs View File

@ -86,7 +86,7 @@ namespace Acme.BookStore
if (await _customerRepository.GetCountAsync() <= 0) if (await _customerRepository.GetCountAsync() <= 0)
{ {
Customer customer = new Customer(1, "soumen", "pal", "9091184026", "haripal");
Customer customer = new Customer(new Guid(), "soumen", "pal", "9091184026", "haripal");
await _customerRepository.InsertAsync( await _customerRepository.InsertAsync(
await _customerManager.CreateAsync(customer) await _customerManager.CreateAsync(customer)


+ 2
- 2
aspnet-core/src/Acme.BookStore.Domain/Customers/Customer.cs View File

@ -8,7 +8,7 @@ using Volo.Abp.Domain.Entities.Auditing;
namespace Acme.BookStore.Customers namespace Acme.BookStore.Customers
{ {
public class Customer : FullAuditedAggregateRoot<int>
public class Customer : FullAuditedAggregateRoot<Guid>
{ {
public string firstName { get; set; } public string firstName { get; set; }
public string lastName { get; set; } public string lastName { get; set; }
@ -18,7 +18,7 @@ namespace Acme.BookStore.Customers
{ {
/* This constructor is for deserialization / ORM purpose */ /* This constructor is for deserialization / ORM purpose */
} }
internal Customer(int id, string firstName, string lastName, string phone, string address) : base(id)
internal Customer(Guid id, string firstName, string lastName, string phone, string address) : base(id)
{ {
this.firstName = firstName; this.firstName = firstName;
this.lastName = lastName; this.lastName = lastName;


+ 1
- 1
aspnet-core/src/Acme.BookStore.Domain/Customers/CustomerManager.cs View File

@ -31,7 +31,7 @@ namespace Acme.BookStore.Customers
throw new CustomerErrorException(customer.phone); throw new CustomerErrorException(customer.phone);
} }
return new Customer( return new Customer(
await _customerRepository.NewCustomerId(),
GuidGenerator.Create(),
customer.firstName, customer.firstName,
customer.lastName, customer.lastName,
customer.phone, customer.phone,


+ 2
- 2
aspnet-core/src/Acme.BookStore.Domain/Customers/ICustomerRepository.cs View File

@ -8,9 +8,9 @@ using Volo.Abp.Domain.Repositories;
namespace Acme.BookStore.Customers namespace Acme.BookStore.Customers
{ {
public interface ICustomerRepository : IRepository<Customer, int>
public interface ICustomerRepository : IRepository<Customer, Guid>
{ {
Task<Customer> FindByPhoneAsync(string phone); Task<Customer> FindByPhoneAsync(string phone);
Task<int> NewCustomerId();
//Task<int> NewCustomerId();
} }
} }

+ 11
- 11
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/BookIssued/EfCoreBookIssueRepository.cs View File

@ -15,7 +15,7 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace Acme.BookStore.BookIssued namespace Acme.BookStore.BookIssued
{ {
public class EfCoreBookIssueRepository : EfCoreRepository<BookStoreDbContext, BookIssue, int>,
public class EfCoreBookIssueRepository : EfCoreRepository<BookStoreDbContext, BookIssue, Guid>,
IBookIssueRepository IBookIssueRepository
{ {
private readonly IDataFilter _dataFilter; private readonly IDataFilter _dataFilter;
@ -28,7 +28,7 @@ namespace Acme.BookStore.BookIssued
_dataFilter = dataFilter; _dataFilter = dataFilter;
} }
public async Task<BookIssueList> FindBookIssueCustomer(int customerId, Guid bookId)
public async Task<BookIssueList> FindBookIssueCustomer(Guid customerId, Guid bookId)
{ {
//var dbSet = await GetDbSetAsync(); //var dbSet = await GetDbSetAsync();
@ -51,17 +51,17 @@ namespace Acme.BookStore.BookIssued
} }
public async Task<int> NewBookIssueId()
{
using (_dataFilter.Disable<ISoftDelete>())
{
var dbSet = await GetDbSetAsync();
var values = await dbSet.MaxAsync(u => (int?)u.Id);
return values == null ? 0 + 1 : (int)values + 1;
//public async Task<int> NewBookIssueId()
//{
// using (_dataFilter.Disable<ISoftDelete>())
// {
// var dbSet = await GetDbSetAsync();
// var values = await dbSet.MaxAsync(u => (Guid?)u.Id);
// return values == null ? 0 + 1 : (int)values + 1;
}
// }
}
//}
public async Task<List<BookIssueList>> BookIssueList() public async Task<List<BookIssueList>> BookIssueList()
{ {


+ 7
- 7
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Customers/EfCoreCustomerRepository.cs View File

@ -11,7 +11,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Acme.BookStore.Customers namespace Acme.BookStore.Customers
{ {
public class EfCoreCustomerRepository : EfCoreRepository<BookStoreDbContext, Customer, int>,
public class EfCoreCustomerRepository : EfCoreRepository<BookStoreDbContext, Customer, Guid>,
ICustomerRepository ICustomerRepository
{ {
public EfCoreCustomerRepository( public EfCoreCustomerRepository(
@ -27,14 +27,14 @@ namespace Acme.BookStore.Customers
} }
public async Task<int> NewCustomerId()
{
var dbSet = await GetDbSetAsync();
var values = await dbSet.MaxAsync(u => (int?)u.Id);
return values == null ? 0 +1: (int)values + 1;
//public async Task<int> NewCustomerId()
//{
// var dbSet = await GetDbSetAsync();
// var values = await dbSet.MaxAsync(u => (Guid?)u.Id);
// return values == null ? 0 +1: (Guid)values + 1;
}
//}
} }
} }

+ 1
- 1
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs View File

@ -132,7 +132,7 @@ public class BookStoreDbContext :
builder.Entity<BookIssue>(b => builder.Entity<BookIssue>(b =>
{ {
b.ToTable(BookStoreConsts.DbTablePrefix + "BookIssued", b.ToTable(BookStoreConsts.DbTablePrefix + "BookIssued",
"BKN");
BookStoreConsts.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();


+ 0
- 2011
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605054852_Created_Book_Entity.Designer.cs
File diff suppressed because it is too large
View File


+ 0
- 43
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605054852_Created_Book_Entity.cs View File

@ -1,43 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Acme.BookStore.Migrations
{
/// <inheritdoc />
public partial class Created_Book_Entity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppBooks",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
PublishDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Price = table.Column<float>(type: "real", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppBooks", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppBooks");
}
}
}

+ 0
- 2077
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605111342_Added_Authors.Designer.cs
File diff suppressed because it is too large
View File


+ 0
- 50
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240605111342_Added_Authors.cs View File

@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Acme.BookStore.Migrations
{
/// <inheritdoc />
public partial class Added_Authors : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppAuthors",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ShortBio = table.Column<string>(type: "nvarchar(max)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppAuthors", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppAuthors_Name",
table: "AppAuthors",
column: "Name");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppAuthors");
}
}
}

+ 0
- 2151
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606070329_Added_Customers.Designer.cs
File diff suppressed because it is too large
View File


+ 0
- 47
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606070329_Added_Customers.cs View File

@ -1,47 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Acme.BookStore.Migrations
{
/// <inheritdoc />
public partial class Added_Customers : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppCustomers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
firstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
lastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
phone = table.Column<string>(type: "nvarchar(14)", maxLength: 14, nullable: false),
address = table.Column<string>(type: "nvarchar(max)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppCustomers", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppCustomers");
}
}
}

+ 0
- 50
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606100414_Added_BookIssued.cs View File

@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Acme.BookStore.Migrations
{
/// <inheritdoc />
public partial class Added_BookIssued : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "BKN");
migrationBuilder.CreateTable(
name: "AppBookIssued",
schema: "BKN",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
bookId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
customerId = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppBookIssued", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppBookIssued",
schema: "BKN");
}
}
}

aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240606100414_Added_BookIssued.Designer.cs → aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240610170422_Change_Table_ColumnType.Designer.cs View File

@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace Acme.BookStore.Migrations namespace Acme.BookStore.Migrations
{ {
[DbContext(typeof(BookStoreDbContext))] [DbContext(typeof(BookStoreDbContext))]
[Migration("20240606100414_Added_BookIssued")]
partial class Added_BookIssued
[Migration("20240610170422_Change_Table_ColumnType")]
partial class Change_Table_ColumnType
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -95,11 +95,8 @@ namespace Acme.BookStore.Migrations
modelBuilder.Entity("Acme.BookStore.BookIssued.BookIssue", b => modelBuilder.Entity("Acme.BookStore.BookIssued.BookIssue", b =>
{ {
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
@ -146,12 +143,12 @@ namespace Acme.BookStore.Migrations
b.Property<Guid>("bookId") b.Property<Guid>("bookId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("customerId")
.HasColumnType("int");
b.Property<Guid>("customerId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("AppBookIssued", "BKN");
b.ToTable("AppBookIssued", (string)null);
}); });
modelBuilder.Entity("Acme.BookStore.Books.Book", b => modelBuilder.Entity("Acme.BookStore.Books.Book", b =>
@ -208,11 +205,8 @@ namespace Acme.BookStore.Migrations
modelBuilder.Entity("Acme.BookStore.Customers.Customer", b => modelBuilder.Entity("Acme.BookStore.Customers.Customer", b =>
{ {
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()

+ 126
- 0
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/20240610170422_Change_Table_ColumnType.cs View File

@ -0,0 +1,126 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Acme.BookStore.Migrations
{
/// <inheritdoc />
public partial class Change_Table_ColumnType : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppAuthors",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ShortBio = table.Column<string>(type: "nvarchar(max)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppAuthors", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppBookIssued",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
bookId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
customerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppBookIssued", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppBooks",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
PublishDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Price = table.Column<float>(type: "real", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppBooks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppCustomers",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
firstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
lastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
phone = table.Column<string>(type: "nvarchar(14)", maxLength: 14, nullable: false),
address = table.Column<string>(type: "nvarchar(max)", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppCustomers", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppAuthors_Name",
table: "AppAuthors",
column: "Name");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppAuthors");
migrationBuilder.DropTable(
name: "AppBookIssued");
migrationBuilder.DropTable(
name: "AppBooks");
migrationBuilder.DropTable(
name: "AppCustomers");
}
}
}

+ 7
- 13
aspnet-core/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs View File

@ -92,11 +92,8 @@ namespace Acme.BookStore.Migrations
modelBuilder.Entity("Acme.BookStore.BookIssued.BookIssue", b => modelBuilder.Entity("Acme.BookStore.BookIssued.BookIssue", b =>
{ {
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
@ -143,12 +140,12 @@ namespace Acme.BookStore.Migrations
b.Property<Guid>("bookId") b.Property<Guid>("bookId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("customerId")
.HasColumnType("int");
b.Property<Guid>("customerId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("AppBookIssued", "BKN");
b.ToTable("AppBookIssued", (string)null);
}); });
modelBuilder.Entity("Acme.BookStore.Books.Book", b => modelBuilder.Entity("Acme.BookStore.Books.Book", b =>
@ -205,11 +202,8 @@ namespace Acme.BookStore.Migrations
modelBuilder.Entity("Acme.BookStore.Customers.Customer", b => modelBuilder.Entity("Acme.BookStore.Customers.Customer", b =>
{ {
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()


Loading…
Cancel
Save