SP_10062024_ColumnTypeChange
This commit is contained in:
parent
c6725c0c01
commit
477245a731
@ -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; }
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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; }
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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; }
|
||||||
|
@ -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
|
||||||
);
|
);
|
||||||
|
@ -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<BookIssueList> FindBookIssueCustomer(Guid customerId, Guid bookId);
|
||||||
Task<int> NewBookIssueId();
|
//Task<int> NewBookIssueId();
|
||||||
Task<List<BookIssueList>> BookIssueList();
|
Task<List<BookIssueList>> BookIssueList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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;
|
||||||
|
@ -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,
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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()
|
//public async Task<int> NewBookIssueId()
|
||||||
{
|
//{
|
||||||
using (_dataFilter.Disable<ISoftDelete>())
|
// using (_dataFilter.Disable<ISoftDelete>())
|
||||||
{
|
// {
|
||||||
var dbSet = await GetDbSetAsync();
|
// var dbSet = await GetDbSetAsync();
|
||||||
var values = await dbSet.MaxAsync(u => (int?)u.Id);
|
// var values = await dbSet.MaxAsync(u => (Guid?)u.Id);
|
||||||
return values == null ? 0 + 1 : (int)values + 1;
|
// return values == null ? 0 + 1 : (int)values + 1;
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
public async Task<List<BookIssueList>> BookIssueList()
|
public async Task<List<BookIssueList>> BookIssueList()
|
||||||
{
|
{
|
||||||
|
@ -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()
|
//public async Task<int> NewCustomerId()
|
||||||
{
|
//{
|
||||||
var dbSet = await GetDbSetAsync();
|
// var dbSet = await GetDbSetAsync();
|
||||||
var values = await dbSet.MaxAsync(u => (int?)u.Id);
|
// var values = await dbSet.MaxAsync(u => (Guid?)u.Id);
|
||||||
return values == null ? 0 +1: (int)values + 1;
|
// return values == null ? 0 +1: (Guid)values + 1;
|
||||||
|
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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")]
|
[Migration("20240610170422_Change_Table_ColumnType")]
|
||||||
partial class Added_BookIssued
|
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")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
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")
|
b.Property<Guid>("customerId")
|
||||||
.HasColumnType("int");
|
.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")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
b.Property<string>("ConcurrencyStamp")
|
||||||
.IsConcurrencyToken()
|
.IsConcurrencyToken()
|
@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
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")
|
b.Property<Guid>("customerId")
|
||||||
.HasColumnType("int");
|
.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")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.HasColumnType("uniqueidentifier");
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
b.Property<string>("ConcurrencyStamp")
|
||||||
.IsConcurrencyToken()
|
.IsConcurrencyToken()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user