refactoring
This commit is contained in:
@@ -9,7 +9,7 @@ public class Account
|
|||||||
public CurrencyGlobal? CurrencyGlobal { get; set; }
|
public CurrencyGlobal? CurrencyGlobal { get; set; }
|
||||||
public string Name { get; set; } = null!;
|
public string Name { get; set; } = null!;
|
||||||
public IEnumerable<AccountAccess>? AccessRights { get; set; }
|
public IEnumerable<AccountAccess>? AccessRights { get; set; }
|
||||||
public IEnumerable<AccountMotion>? Motions { get; set; }
|
public IEnumerable<Motion>? Motions { get; set; }
|
||||||
public IEnumerable<AccountAccountCategory>? Categories { get; set; }
|
public IEnumerable<AccountAccountCategory>? Categories { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-4
@@ -1,16 +1,20 @@
|
|||||||
namespace MyOffice.Data.Models.Accounts;
|
namespace MyOffice.Data.Models.Accounts;
|
||||||
|
|
||||||
using MyOffice.Data.Models.Motions;
|
using Items;
|
||||||
|
|
||||||
public class AccountMotion
|
/// <summary>
|
||||||
|
/// Account motion
|
||||||
|
/// DateTime: 2023-01-01, Account: 'Debit card', Item.ItemGlobal: 'Primary salary', AmountPlus: 5000
|
||||||
|
/// </summary>
|
||||||
|
public class Motion
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public DateTime CreatedOn { get; set; }
|
public DateTime CreatedOn { get; set; }
|
||||||
public DateTime DateTime { get; set; }
|
public DateTime DateTime { get; set; }
|
||||||
public int MotionId { get; set; }
|
|
||||||
public MotionAccount Motion { get; set; } = null!;
|
|
||||||
public Guid AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account Account { get; set; } = null!;
|
public Account Account { get; set; } = null!;
|
||||||
|
public int ItemId { get; set; }
|
||||||
|
public Item Item { get; set; } = null!;
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public decimal AmountPlus { get; set; }
|
public decimal AmountPlus { get; set; }
|
||||||
public decimal AmountMinus { get; set; }
|
public decimal AmountMinus { get; set; }
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
namespace MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Accounts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// User 'Item' linked to global item
|
||||||
|
/// ItemGlobal: 'Primary salary', ItemCategory: 'Incomes'
|
||||||
|
/// </summary>
|
||||||
|
public class Item
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public Guid CategoryId { get; set; }
|
||||||
|
public ItemCategory Category { get; set; } = null!;
|
||||||
|
public Guid ItemGlobalId { get; set; }
|
||||||
|
public ItemGlobal ItemGlobal { get; set; } = null!;
|
||||||
|
public IEnumerable<Motion> Motions { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Users;
|
||||||
|
|
||||||
|
public class ItemCategory
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public Guid UserId { get; set; }
|
||||||
|
public User User { get; set; } = null!;
|
||||||
|
public string Name { get; set; } = null!;
|
||||||
|
public IEnumerable<Item> Items { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public class ItemGlobal
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Name { get; set; } = null!;
|
||||||
|
public IEnumerable<Item> Items { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace MyOffice.Data.Models.Motions;
|
|
||||||
|
|
||||||
using Accounts;
|
|
||||||
|
|
||||||
public class MotionAccount
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public Guid CategoryId { get; set; }
|
|
||||||
public MotionCategory Category { get; set; } = null!;
|
|
||||||
public Guid MotionGlobalId { get; set; }
|
|
||||||
public MotionGlobal MotionGlobal { get; set; } = null!;
|
|
||||||
public IEnumerable<AccountMotion> Motions { get; set; } = null!;
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace MyOffice.Data.Models.Motions;
|
|
||||||
|
|
||||||
using Users;
|
|
||||||
|
|
||||||
public class MotionCategory
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
public Guid UserId { get; set; }
|
|
||||||
public User User { get; set; } = null!;
|
|
||||||
public string Name { get; set; } = null!;
|
|
||||||
public IEnumerable<MotionAccount> Motions { get; set; } = null!;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace MyOffice.Data.Models.Motions;
|
|
||||||
|
|
||||||
public class MotionGlobal
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
public string Name { get; set; } = null!;
|
|
||||||
public IEnumerable<MotionAccount> Motions { get; set; } = null!;
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
using Accounts;
|
using Accounts;
|
||||||
using Currencies;
|
using Currencies;
|
||||||
using Motions;
|
using Items;
|
||||||
|
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
||||||
@@ -26,7 +26,7 @@ public class User
|
|||||||
public CurrencyGlobal? Currency { get; set; }
|
public CurrencyGlobal? Currency { get; set; }
|
||||||
public IEnumerable<Currency>? Currencies { get; set; }
|
public IEnumerable<Currency>? Currencies { get; set; }
|
||||||
public IEnumerable<AccountAccess>? AccountAccess { get; set; }
|
public IEnumerable<AccountAccess>? AccountAccess { get; set; }
|
||||||
public IEnumerable<AccountMotion>? AccountMotions { get; set; }
|
public IEnumerable<Motion>? AccountMotions { get; set; }
|
||||||
public IEnumerable<AccountCategory>? AccountCategories { get; set; }
|
public IEnumerable<AccountCategory>? AccountCategories { get; set; }
|
||||||
public IEnumerable<MotionCategory>? MotionCategories { get; set; }
|
public IEnumerable<ItemCategory>? ItemCategories { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Account;
|
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Models.Accounts;
|
|
||||||
|
|
||||||
public class AccountMotionRepository : AppRepository<AccountMotion>, IAccountMotionRepository
|
|
||||||
{
|
|
||||||
public bool Add(AccountMotion accountMotion)
|
|
||||||
{
|
|
||||||
return AddBase(accountMotion) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<AccountMotion> GetByAccount(Guid accountId, DateTime dateFrom, DateTime dateTo)
|
|
||||||
{
|
|
||||||
return _context
|
|
||||||
.AccountMotions
|
|
||||||
.Include(x => x.Motion)
|
|
||||||
.ThenInclude(x => x.MotionGlobal)
|
|
||||||
.Where(x => x.AccountId == accountId && x.DateTime >= dateFrom && x.DateTime <= dateTo)
|
|
||||||
.OrderByDescending(x => x.DateTime)
|
|
||||||
.ThenByDescending(x => x.CreatedOn)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Account;
|
|
||||||
|
|
||||||
using Models.Accounts;
|
|
||||||
|
|
||||||
public interface IAccountMotionRepository
|
|
||||||
{
|
|
||||||
bool Add(AccountMotion accountMotion);
|
|
||||||
List<AccountMotion> GetByAccount(Guid accountId, DateTime dateFrom, DateTime dateTo);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Account;
|
||||||
|
|
||||||
|
using Models.Accounts;
|
||||||
|
|
||||||
|
public interface IMotionRepository
|
||||||
|
{
|
||||||
|
bool Add(Motion motion);
|
||||||
|
List<Motion> GetByAccount(Guid accountId, DateTime dateFrom, DateTime dateTo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Account;
|
||||||
|
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Models.Accounts;
|
||||||
|
|
||||||
|
public class MotionRepository : AppRepository<Motion>, IMotionRepository
|
||||||
|
{
|
||||||
|
public bool Add(Motion motion)
|
||||||
|
{
|
||||||
|
return AddBase(motion) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Motion> GetByAccount(Guid accountId, DateTime dateFrom, DateTime dateTo)
|
||||||
|
{
|
||||||
|
return _context
|
||||||
|
.Motions
|
||||||
|
.Include(x => x.Item)
|
||||||
|
.ThenInclude(x => x.ItemGlobal)
|
||||||
|
.Where(x => x.AccountId == accountId && x.DateTime >= dateFrom && x.DateTime <= dateTo)
|
||||||
|
.OrderByDescending(x => x.DateTime)
|
||||||
|
.ThenByDescending(x => x.CreatedOn)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public interface IItemCategoryRepository
|
||||||
|
{
|
||||||
|
List<ItemCategory> GetAll(Guid userId);
|
||||||
|
bool Add(ItemCategory accountCategory);
|
||||||
|
ItemCategory? Get(Guid userId, Guid id);
|
||||||
|
bool Update(ItemCategory accountCategory);
|
||||||
|
bool Remove(ItemCategory accountCategory);
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public interface IItemGlobalRepository
|
||||||
|
{
|
||||||
|
ItemGlobal? Get(Guid id);
|
||||||
|
ItemGlobal? GetByName(string name);
|
||||||
|
bool Add(ItemGlobal itemGlobal);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public interface IItemRepository
|
||||||
|
{
|
||||||
|
List<Item> GetAll(Guid userId);
|
||||||
|
List<Item> GetByCategory(Guid userId, Guid categoryId);
|
||||||
|
|
||||||
|
Item? GetByGlobal(Guid userId, Guid globalMotionId);
|
||||||
|
bool Add(Item item);
|
||||||
|
bool Update(Item item);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public class ItemCategoryRepository : AppRepository<ItemCategory>, IItemCategoryRepository
|
||||||
|
{
|
||||||
|
public List<ItemCategory> GetAll(Guid userId)
|
||||||
|
{
|
||||||
|
return _context.ItemCategories
|
||||||
|
.Include(x => x.Items)
|
||||||
|
.Where(x => x.UserId == userId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Add(ItemCategory itemCategory)
|
||||||
|
{
|
||||||
|
return AddBase(itemCategory) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemCategory? Get(Guid userId, Guid id)
|
||||||
|
{
|
||||||
|
return _context.ItemCategories
|
||||||
|
.Include(x => x.Items)
|
||||||
|
.FirstOrDefault(x => x.Id == id && x.UserId == userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Update(ItemCategory itemCategory)
|
||||||
|
{
|
||||||
|
return UpdateBase(itemCategory) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remove(ItemCategory itemCategory)
|
||||||
|
{
|
||||||
|
return RemoveBase(itemCategory) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public class ItemGlobalRepository : AppRepository<ItemGlobal>, IItemGlobalRepository
|
||||||
|
{
|
||||||
|
public ItemGlobal? Get(Guid id)
|
||||||
|
{
|
||||||
|
return _context.ItemGlobals.FirstOrDefault(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemGlobal? GetByName(string name)
|
||||||
|
{
|
||||||
|
return _context.ItemGlobals.FirstOrDefault(x => x.Name == name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Add(ItemGlobal itemGlobal)
|
||||||
|
{
|
||||||
|
return AddBase(itemGlobal) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
namespace MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MyOffice.Data.Models.Items;
|
||||||
|
|
||||||
|
public class ItemRepository : AppRepository<Item>, IItemRepository
|
||||||
|
{
|
||||||
|
public List<Item> GetAll(Guid userId)
|
||||||
|
{
|
||||||
|
return _context.Items
|
||||||
|
.Include(x => x.Motions)
|
||||||
|
.Include(x => x.Category)
|
||||||
|
.Include(x => x.ItemGlobal)
|
||||||
|
.Where(x => x.Category.UserId == userId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Item> GetByCategory(Guid userId, Guid categoryId)
|
||||||
|
{
|
||||||
|
return _context.Items
|
||||||
|
.Include(x => x.Motions)
|
||||||
|
.Include(x => x.Category)
|
||||||
|
.Include(x => x.ItemGlobal)
|
||||||
|
.Where(x => x.Category.UserId == userId && x.CategoryId == categoryId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item? GetByGlobal(Guid userId, Guid globalMotionId)
|
||||||
|
{
|
||||||
|
return _context.Items
|
||||||
|
.Include(x => x.Motions)
|
||||||
|
.Include(x => x.Category)
|
||||||
|
.Include(x => x.ItemGlobal)
|
||||||
|
.FirstOrDefault(x => x.Category.UserId == userId && x.ItemGlobalId == globalMotionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Update(Item item)
|
||||||
|
{
|
||||||
|
return base.UpdateBase(item) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Add(Item item)
|
||||||
|
{
|
||||||
|
return base.AddBase(item) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public interface IMotionCategoryRepository
|
|
||||||
{
|
|
||||||
List<MotionCategory> GetAll(Guid userId);
|
|
||||||
bool Add(MotionCategory accountCategory);
|
|
||||||
MotionCategory? Get(Guid userId, Guid id);
|
|
||||||
bool Update(MotionCategory accountCategory);
|
|
||||||
bool Remove(MotionCategory accountCategory);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public interface IMotionGlobalRepository
|
|
||||||
{
|
|
||||||
MotionGlobal? Get(Guid id);
|
|
||||||
MotionGlobal? GetByName(string name);
|
|
||||||
bool Add(MotionGlobal motionGlobal);
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public interface IMotionRepository
|
|
||||||
{
|
|
||||||
List<MotionAccount> GetAll(Guid userId);
|
|
||||||
List<MotionAccount> GetByCategory(Guid userId, Guid categoryId);
|
|
||||||
|
|
||||||
MotionAccount? GetByGlobal(Guid userId, Guid globalMotionId);
|
|
||||||
bool Add(MotionAccount motionAccount);
|
|
||||||
bool Update(MotionAccount motionAccount);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public class MotionCategoryRepository : AppRepository<MotionCategory>, IMotionCategoryRepository
|
|
||||||
{
|
|
||||||
public List<MotionCategory> GetAll(Guid userId)
|
|
||||||
{
|
|
||||||
return _context.MotionCategories
|
|
||||||
.Include(x => x.Motions)
|
|
||||||
.Where(x => x.UserId == userId)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Add(MotionCategory motionCategory)
|
|
||||||
{
|
|
||||||
return AddBase(motionCategory) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MotionCategory? Get(Guid userId, Guid id)
|
|
||||||
{
|
|
||||||
return _context.MotionCategories
|
|
||||||
.Include(x => x.Motions)
|
|
||||||
.FirstOrDefault(x => x.Id == id && x.UserId == userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Update(MotionCategory motionCategory)
|
|
||||||
{
|
|
||||||
return UpdateBase(motionCategory) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Remove(MotionCategory motionCategory)
|
|
||||||
{
|
|
||||||
return RemoveBase(motionCategory) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public class MotionGlobalRepository : AppRepository<MotionGlobal>, IMotionGlobalRepository
|
|
||||||
{
|
|
||||||
public MotionGlobal? Get(Guid id)
|
|
||||||
{
|
|
||||||
return _context.GlobalMotions.FirstOrDefault(x => x.Id == id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MotionGlobal? GetByName(string name)
|
|
||||||
{
|
|
||||||
return _context.GlobalMotions.FirstOrDefault(x => x.Name == name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Add(MotionGlobal motionGlobal)
|
|
||||||
{
|
|
||||||
return AddBase(motionGlobal) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
namespace MyOffice.Data.Repositories.Motion;
|
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Models.Motions;
|
|
||||||
|
|
||||||
public class MotionRepository : AppRepository<MotionAccount>, IMotionRepository
|
|
||||||
{
|
|
||||||
public List<MotionAccount> GetAll(Guid userId)
|
|
||||||
{
|
|
||||||
return _context.Motions
|
|
||||||
.Include(x => x.Motions)
|
|
||||||
.Include(x => x.Category)
|
|
||||||
.Include(x => x.MotionGlobal)
|
|
||||||
.Where(x => x.Category.UserId == userId)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MotionAccount> GetByCategory(Guid userId, Guid categoryId)
|
|
||||||
{
|
|
||||||
return _context.Motions
|
|
||||||
.Include(x => x.Motions)
|
|
||||||
.Include(x => x.Category)
|
|
||||||
.Include(x => x.MotionGlobal)
|
|
||||||
.Where(x => x.Category.UserId == userId && x.CategoryId == categoryId)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MotionAccount? GetByGlobal(Guid userId, Guid globalMotionId)
|
|
||||||
{
|
|
||||||
return _context.Motions
|
|
||||||
.Include(x => x.Motions)
|
|
||||||
.Include(x => x.Category)
|
|
||||||
.Include(x => x.MotionGlobal)
|
|
||||||
.FirstOrDefault(x => x.Category.UserId == userId && x.MotionGlobalId == globalMotionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Update(MotionAccount motionAccount)
|
|
||||||
{
|
|
||||||
return base.UpdateBase(motionAccount) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Add(MotionAccount motionAccount)
|
|
||||||
{
|
|
||||||
return base.AddBase(motionAccount) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
using Data.Models.Accounts;
|
using Data.Models.Accounts;
|
||||||
using Data.Models.Currencies;
|
using Data.Models.Currencies;
|
||||||
using Data.Models.Motions;
|
using Data.Models.Items;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Data.Models.Users;
|
using Data.Models.Users;
|
||||||
|
|
||||||
@@ -39,10 +39,10 @@ public class AppDbContext : DbContext
|
|||||||
public DbSet<AccountAccountCategory> AccountAccountCategories { get; set; } = null!;
|
public DbSet<AccountAccountCategory> AccountAccountCategories { get; set; } = null!;
|
||||||
public DbSet<AccountAccess> AccountAccesses { get; set; } = null!;
|
public DbSet<AccountAccess> AccountAccesses { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<MotionGlobal> GlobalMotions { get; set; } = null!;
|
public DbSet<ItemCategory> ItemCategories { get; set; } = null!;
|
||||||
public DbSet<MotionCategory> MotionCategories { get; set; } = null!;
|
public DbSet<ItemGlobal> ItemGlobals { get; set; } = null!;
|
||||||
public DbSet<MotionAccount> Motions { get; set; } = null!;
|
public DbSet<Item> Items { get; set; } = null!;
|
||||||
public DbSet<AccountMotion> AccountMotions { get; set; } = null!;
|
public DbSet<Motion> Motions { get; set; } = null!;
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@ public class AppDbContext : DbContext
|
|||||||
modelBuilder.Entity<AccountAccess>()
|
modelBuilder.Entity<AccountAccess>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountCategory>()
|
modelBuilder.Entity<AccountCategory>()
|
||||||
@@ -149,7 +149,7 @@ public class AppDbContext : DbContext
|
|||||||
.WithMany(x => x.AccountAccess)
|
.WithMany(x => x.AccountAccess)
|
||||||
.HasForeignKey(x => x.UserId);
|
.HasForeignKey(x => x.UserId);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.HasOne(x => x.Account)
|
.HasOne(x => x.Account)
|
||||||
.WithMany(x => x.Motions)
|
.WithMany(x => x.Motions)
|
||||||
.HasForeignKey(x => x.AccountId);
|
.HasForeignKey(x => x.AccountId);
|
||||||
@@ -172,45 +172,45 @@ public class AppDbContext : DbContext
|
|||||||
|
|
||||||
private void MotionsCreating(ModelBuilder modelBuilder)
|
private void MotionsCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
modelBuilder.Entity<MotionGlobal>()
|
modelBuilder.Entity<ItemGlobal>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
modelBuilder.Entity<MotionCategory>()
|
modelBuilder.Entity<ItemCategory>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
modelBuilder.Entity<MotionAccount>()
|
modelBuilder.Entity<Item>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.HasKey(x => x.Id);
|
.HasKey(x => x.Id);
|
||||||
|
|
||||||
modelBuilder.Entity<MotionCategory>()
|
modelBuilder.Entity<ItemCategory>()
|
||||||
.HasOne(x => x.User)
|
.HasOne(x => x.User)
|
||||||
.WithMany(x => x.MotionCategories)
|
.WithMany(x => x.ItemCategories)
|
||||||
.HasForeignKey(x => x.UserId);
|
.HasForeignKey(x => x.UserId);
|
||||||
|
|
||||||
modelBuilder.Entity<MotionAccount>()
|
modelBuilder.Entity<Item>()
|
||||||
.HasOne(x => x.Category)
|
.HasOne(x => x.Category)
|
||||||
.WithMany(x => x.Motions)
|
.WithMany(x => x.Items)
|
||||||
.HasForeignKey(x => x.CategoryId);
|
.HasForeignKey(x => x.CategoryId);
|
||||||
|
|
||||||
modelBuilder.Entity<MotionAccount>()
|
modelBuilder.Entity<Item>()
|
||||||
.HasOne(x => x.MotionGlobal)
|
.HasOne(x => x.ItemGlobal)
|
||||||
.WithMany(x => x.Motions)
|
.WithMany(x => x.Items)
|
||||||
.HasForeignKey(x => x.MotionGlobalId);
|
.HasForeignKey(x => x.ItemGlobalId);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.HasOne(x => x.Motion)
|
.HasOne(x => x.Item)
|
||||||
.WithMany(x => x.Motions)
|
.WithMany(x => x.Motions)
|
||||||
.HasForeignKey(x => x.MotionId);
|
.HasForeignKey(x => x.ItemId);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.HasOne(x => x.Account)
|
.HasOne(x => x.Account)
|
||||||
.WithMany(x => x.Motions)
|
.WithMany(x => x.Motions)
|
||||||
.HasForeignKey(x => x.AccountId);
|
.HasForeignKey(x => x.AccountId);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.Property(x => x.AmountMinus)
|
.Property(x => x.AmountMinus)
|
||||||
.HasPrecision(18, 6);
|
.HasPrecision(18, 6);
|
||||||
|
|
||||||
modelBuilder.Entity<AccountMotion>()
|
modelBuilder.Entity<Motion>()
|
||||||
.Property(x => x.AmountPlus)
|
.Property(x => x.AmountPlus)
|
||||||
.HasPrecision(18, 6);
|
.HasPrecision(18, 6);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class RepositoryInitializer
|
|||||||
new() { Id = "BTC", DefaultQuantity = 10, Symbol = "btc", Name = "Bitcoin" },
|
new() { Id = "BTC", DefaultQuantity = 10, Symbol = "btc", Name = "Bitcoin" },
|
||||||
new() { Id = "ETH", DefaultQuantity = 10, Symbol = "eth", Name = "Ethereum" },
|
new() { Id = "ETH", DefaultQuantity = 10, Symbol = "eth", Name = "Ethereum" },
|
||||||
new() { Id = "TON", DefaultQuantity = 10, Symbol = "ton", Name = "TON" },
|
new() { Id = "TON", DefaultQuantity = 10, Symbol = "ton", Name = "TON" },
|
||||||
new() { Id = "OTHER", DefaultQuantity = 1, Symbol = "₽", Name = "Other" },
|
new() { Id = "OTHER", DefaultQuantity = 1, Symbol = "", Name = "Other" },
|
||||||
};
|
};
|
||||||
|
|
||||||
var currencyGlobals = dbContext.CurrencyGlobals.ToList();
|
var currencyGlobals = dbContext.CurrencyGlobals.ToList();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
namespace MyOffice.Migrations;
|
namespace MyOffice.Migrations.Postgres;
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
using Microsoft.EntityFrameworkCore.Design;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using DbContext;
|
using MyOffice.DbContext;
|
||||||
using Shared;
|
using MyOffice.Shared;
|
||||||
|
|
||||||
public class AppDbContextFactoryPostgres : IDesignTimeDbContextFactory<AppDbContext>
|
public class AppDbContextFactoryPostgres : IDesignTimeDbContextFactory<AppDbContext>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230408172132_init")]
|
|
||||||
partial class init
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class init : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterDatabase()
|
|
||||||
.Annotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Users",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
UserName = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
|
||||||
Email = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
|
||||||
PasswordHash = table.Column<string>(type: "text", nullable: false),
|
|
||||||
FirstName = table.Column<string>(type: "text", nullable: true),
|
|
||||||
LastName = table.Column<string>(type: "text", nullable: true),
|
|
||||||
FullName = table.Column<string>(type: "text", nullable: true),
|
|
||||||
IsEmailConfirmed = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Users", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "UserClaims",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
ExternalId = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Email = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
|
||||||
Provider = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation")
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_UserClaims", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_UserClaims_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_UserClaims_UserId",
|
|
||||||
table: "UserClaims",
|
|
||||||
column: "UserId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "UserClaims");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230408172213_phone")]
|
|
||||||
partial class phone
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class phone : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "Phone",
|
|
||||||
table: "Users",
|
|
||||||
type: "text",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Phone",
|
|
||||||
table: "Users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,386 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230429063332_Host")]
|
|
||||||
partial class Host
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class Host : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "CurrencyGlobals",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
ShortName = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_CurrencyGlobals", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Accounts",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
CurrencyGlobalId = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Accounts", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Accounts_CurrencyGlobals_CurrencyGlobalId",
|
|
||||||
column: x => x.CurrencyGlobalId,
|
|
||||||
principalTable: "CurrencyGlobals",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Currencies",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
CurrencyGlobalId = table.Column<string>(type: "text", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
ShortName = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Currencies", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Currencies_CurrencyGlobals_CurrencyGlobalId",
|
|
||||||
column: x => x.CurrencyGlobalId,
|
|
||||||
principalTable: "CurrencyGlobals",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Currencies_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountAccesses",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
IsAllowRead = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
IsAllowWrite = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
IsAllowManage = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountAccesses", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountAccesses_Accounts_AccountId",
|
|
||||||
column: x => x.AccountId,
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountAccesses_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountMotions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
AmountIn = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
AmountOut = table.Column<decimal>(type: "numeric", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountMotions", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Accounts_AccountId",
|
|
||||||
column: x => x.AccountId,
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "CurrencyRates",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
CurrencyId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
Rate = table.Column<decimal>(type: "numeric", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_CurrencyRates", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_CurrencyRates_Currencies_CurrencyId",
|
|
||||||
column: x => x.CurrencyId,
|
|
||||||
principalTable: "Currencies",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountAccesses_AccountId",
|
|
||||||
table: "AccountAccesses",
|
|
||||||
column: "AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountAccesses_UserId",
|
|
||||||
table: "AccountAccesses",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_AccountId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Accounts_CurrencyGlobalId",
|
|
||||||
table: "Accounts",
|
|
||||||
column: "CurrencyGlobalId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Currencies_CurrencyGlobalId",
|
|
||||||
table: "Currencies",
|
|
||||||
column: "CurrencyGlobalId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Currencies_UserId",
|
|
||||||
table: "Currencies",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_CurrencyRates_CurrencyId",
|
|
||||||
table: "CurrencyRates",
|
|
||||||
column: "CurrencyId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountAccesses");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "CurrencyRates");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Accounts");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Currencies");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "CurrencyGlobals");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-407
@@ -1,407 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230429090658_user_currency")]
|
|
||||||
partial class usercurrency
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class usercurrency : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "CurrencyId",
|
|
||||||
table: "Users",
|
|
||||||
type: "text",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "Symbol",
|
|
||||||
table: "CurrencyGlobals",
|
|
||||||
type: "text",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Users_CurrencyId",
|
|
||||||
table: "Users",
|
|
||||||
column: "CurrencyId");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Users_CurrencyGlobals_CurrencyId",
|
|
||||||
table: "Users",
|
|
||||||
column: "CurrencyId",
|
|
||||||
principalTable: "CurrencyGlobals",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Users_CurrencyGlobals_CurrencyId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_Users_CurrencyId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "CurrencyId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Symbol",
|
|
||||||
table: "CurrencyGlobals");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-403
@@ -1,403 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230429092104_currency_shortname")]
|
|
||||||
partial class currencyshortname
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class currencyshortname : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "Currencies");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "Currencies",
|
|
||||||
type: "text",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-403
@@ -1,403 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230429092950_gcurrency_shortname")]
|
|
||||||
partial class gcurrencyshortname
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Account.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Account.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class gcurrencyshortname : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "CurrencyGlobals");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "Currencies",
|
|
||||||
type: "text",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "Currencies");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "ShortName",
|
|
||||||
table: "CurrencyGlobals",
|
|
||||||
type: "text",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-467
@@ -1,467 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230430103617_account_category")]
|
|
||||||
partial class accountcategory
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class accountcategory : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountCategory",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountCategory", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountAccountCategory",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
CategoryId = table.Column<Guid>(type: "uuid", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountAccountCategory", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_AccountCategory_AccountId",
|
|
||||||
column: x => x.AccountId,
|
|
||||||
principalTable: "AccountCategory",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_Accounts_CategoryId",
|
|
||||||
column: x => x.CategoryId,
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountAccountCategory_AccountId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
column: "AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountAccountCategory_CategoryId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
column: "CategoryId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountAccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountCategory");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-473
@@ -1,473 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230601100601_CurrencyQuantity")]
|
|
||||||
partial class CurrencyQuantity
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class CurrencyQuantity : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Quantity",
|
|
||||||
table: "CurrencyRates",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "Currencies",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Quantity",
|
|
||||||
table: "CurrencyRates");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "Currencies");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-473
@@ -1,473 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230601100833_CurrencyQuantity2")]
|
|
||||||
partial class CurrencyQuantity2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategory");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class CurrencyQuantity2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "Currencies");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "CurrencyGlobals",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "CurrencyGlobals");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "DefaultQuantity",
|
|
||||||
table: "Currencies",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-491
@@ -1,491 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230601121013_AccountCategories")]
|
|
||||||
partial class AccountCategories
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AccountCategories : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_AccountCategory_AccountId",
|
|
||||||
table: "AccountAccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_AccountCategory",
|
|
||||||
table: "AccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_AccountAccountCategory",
|
|
||||||
table: "AccountAccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "AccountCategory",
|
|
||||||
newName: "AccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "AccountAccountCategory",
|
|
||||||
newName: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.RenameIndex(
|
|
||||||
name: "IX_AccountAccountCategory_CategoryId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
newName: "IX_AccountAccountCategories_CategoryId");
|
|
||||||
|
|
||||||
migrationBuilder.RenameIndex(
|
|
||||||
name: "IX_AccountAccountCategory_AccountId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
newName: "IX_AccountAccountCategories_AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "UserId",
|
|
||||||
table: "AccountCategories",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_AccountCategories",
|
|
||||||
table: "AccountCategories",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_AccountAccountCategories",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountCategories_UserId",
|
|
||||||
table: "AccountCategories",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_AccountId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "AccountId",
|
|
||||||
principalTable: "AccountCategories",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "CategoryId",
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountCategories_Users_UserId",
|
|
||||||
table: "AccountCategories",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_AccountId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountCategories_Users_UserId",
|
|
||||||
table: "AccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_AccountCategories",
|
|
||||||
table: "AccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_AccountCategories_UserId",
|
|
||||||
table: "AccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_AccountAccountCategories",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "UserId",
|
|
||||||
table: "AccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "AccountCategories",
|
|
||||||
newName: "AccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "AccountAccountCategories",
|
|
||||||
newName: "AccountAccountCategory");
|
|
||||||
|
|
||||||
migrationBuilder.RenameIndex(
|
|
||||||
name: "IX_AccountAccountCategories_CategoryId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
newName: "IX_AccountAccountCategory_CategoryId");
|
|
||||||
|
|
||||||
migrationBuilder.RenameIndex(
|
|
||||||
name: "IX_AccountAccountCategories_AccountId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
newName: "IX_AccountAccountCategory_AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_AccountCategory",
|
|
||||||
table: "AccountCategory",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_AccountAccountCategory",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_AccountCategory_AccountId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
column: "AccountId",
|
|
||||||
principalTable: "AccountCategory",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategory_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategory",
|
|
||||||
column: "CategoryId",
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-491
@@ -1,491 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230609062452_AccountCategoriesFix")]
|
|
||||||
partial class AccountCategoriesFix
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountIn")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountOut")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currency.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currency.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AccountCategoriesFix : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_AccountId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_CategoryId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "CategoryId",
|
|
||||||
principalTable: "AccountCategories",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_AccountId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "AccountId",
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_CategoryId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_AccountId",
|
|
||||||
table: "AccountAccountCategories");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_AccountCategories_AccountId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "AccountId",
|
|
||||||
principalTable: "AccountCategories",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountAccountCategories_Accounts_CategoryId",
|
|
||||||
table: "AccountAccountCategories",
|
|
||||||
column: "CategoryId",
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,606 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230611145152_Motion")]
|
|
||||||
partial class Motion
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class Motion : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
|
||||||
name: "AmountOut",
|
|
||||||
table: "AccountMotions",
|
|
||||||
newName: "AmountPlus");
|
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
|
||||||
name: "AmountIn",
|
|
||||||
table: "AccountMotions",
|
|
||||||
newName: "AmountMinus");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "Description",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "text",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "MotionId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "GlobalMotions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_GlobalMotions", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "MotionCategories",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_MotionCategories", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_MotionCategories_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Motions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
CategoryId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
MotionGlobalId = table.Column<Guid>(type: "uuid", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Motions", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
column: x => x.MotionGlobalId,
|
|
||||||
principalTable: "GlobalMotions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Motions_MotionCategories_CategoryId",
|
|
||||||
column: x => x.CategoryId,
|
|
||||||
principalTable: "MotionCategories",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_MotionId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "MotionId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_MotionCategories_UserId",
|
|
||||||
table: "MotionCategories",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Motions_CategoryId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "CategoryId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Motions_MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "MotionGlobalId");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountMotions_Motions_MotionId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "MotionId",
|
|
||||||
principalTable: "Motions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountMotions_Motions_MotionId",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Motions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "GlobalMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "MotionCategories");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_AccountMotions_MotionId",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Description",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "MotionId",
|
|
||||||
table: "AccountMotions");
|
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
|
||||||
name: "AmountPlus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
newName: "AmountOut");
|
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
|
||||||
name: "AmountMinus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
newName: "AmountIn");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<long>(
|
|
||||||
name: "Id",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "bigint",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-609
@@ -1,609 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230614175616_MotionCategoryFix")]
|
|
||||||
partial class MotionCategoryFix
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid?>("MotionGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionCategoryFix : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
/*migrationBuilder.AlterColumn<long>(
|
|
||||||
name: "Id",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "bigint",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
/*migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "Id",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(long),
|
|
||||||
oldType: "bigint")
|
|
||||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-606
@@ -1,606 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230614181358_MotionCategoryFix2")]
|
|
||||||
partial class MotionCategoryFix2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid?>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionCategoryFix2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "MotionGlobalId",
|
|
||||||
principalTable: "GlobalMotions",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "MotionGlobalId",
|
|
||||||
principalTable: "GlobalMotions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-608
@@ -1,608 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230614183224_MotionCategoryFix3")]
|
|
||||||
partial class MotionCategoryFix3
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionCategoryFix3 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "MotionGlobalId",
|
|
||||||
principalTable: "GlobalMotions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Motions_GlobalMotions_MotionGlobalId",
|
|
||||||
table: "Motions",
|
|
||||||
column: "MotionGlobalId",
|
|
||||||
principalTable: "GlobalMotions",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-533
@@ -1,533 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230617113630_MotionAccountFix")]
|
|
||||||
partial class MotionAccountFix
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionAccountFix : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountMotions");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountMotions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
MotionId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
AmountMinus = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
AmountPlus = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
Description = table.Column<string>(type: "text", nullable: true),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountMotions", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Accounts_AccountId",
|
|
||||||
column: x => x.AccountId,
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Motions_MotionId",
|
|
||||||
column: x => x.MotionId,
|
|
||||||
principalTable: "Motions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_AccountId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_MotionId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "MotionId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "UserId");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-606
@@ -1,606 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230617114210_MotionAccountFix2")]
|
|
||||||
partial class MotionAccountFix2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionAccountFix2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AccountMotions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
MotionId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
Description = table.Column<string>(type: "text", nullable: true),
|
|
||||||
AmountPlus = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
AmountMinus = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AccountMotions", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Accounts_AccountId",
|
|
||||||
column: x => x.AccountId,
|
|
||||||
principalTable: "Accounts",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Motions_MotionId",
|
|
||||||
column: x => x.MotionId,
|
|
||||||
principalTable: "Motions",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_AccountMotions_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_AccountId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "AccountId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_MotionId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "MotionId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AccountMotions_UserId",
|
|
||||||
table: "AccountMotions",
|
|
||||||
column: "UserId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "AccountMotions");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-607
@@ -1,607 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230621082718_MotionPrec")]
|
|
||||||
partial class MotionPrec
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasPrecision(6)
|
|
||||||
.HasColumnType("numeric(6)");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionPrec : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountMinus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric(6)",
|
|
||||||
precision: 6,
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountMinus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric(6)",
|
|
||||||
oldPrecision: 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-607
@@ -1,607 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230621083359_MotionPrec2")]
|
|
||||||
partial class MotionPrec2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.0")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowManage")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowRead")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAllowWrite")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccesses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.ToTable("AccountAccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("AccountId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountMinus")
|
|
||||||
.HasPrecision(18, 6)
|
|
||||||
.HasColumnType("numeric(18,6)");
|
|
||||||
|
|
||||||
b.Property<decimal>("AmountPlus")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("AccountId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyGlobalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyGlobalId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("DefaultQuantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyGlobals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CurrencyId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateTime")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Quantity")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<decimal>("Rate")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("CurrencyRates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<Guid>("CategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
|
||||||
|
|
||||||
b.ToTable("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("CurrencyId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("CurrencyId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text")
|
|
||||||
.UseCollation("my_ci_collation");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccess", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("AccessRights")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountAccess")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountAccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Categories")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.AccountCategory", "Category")
|
|
||||||
.WithMany("Accounts")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("AccountCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("AccountId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", null)
|
|
||||||
.WithMany("AccountMotions")
|
|
||||||
.HasForeignKey("UserId");
|
|
||||||
|
|
||||||
b.Navigation("Account");
|
|
||||||
|
|
||||||
b.Navigation("Motion");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "CurrencyGlobal")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("CurrencyGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("Currencies")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("CurrencyGlobal");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyRate", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.Currency", "Currency")
|
|
||||||
.WithMany("Rates")
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("CategoryId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
|
||||||
.WithMany("Motions")
|
|
||||||
.HasForeignKey("MotionGlobalId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Category");
|
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("MotionCategories")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Currencies.CurrencyGlobal", "Currency")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CurrencyId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Currency");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Account", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccessRights");
|
|
||||||
|
|
||||||
b.Navigation("Categories");
|
|
||||||
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Rates");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.CurrencyGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Accounts");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Motions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("AccountAccess");
|
|
||||||
|
|
||||||
b.Navigation("AccountCategories");
|
|
||||||
|
|
||||||
b.Navigation("AccountMotions");
|
|
||||||
|
|
||||||
b.Navigation("Currencies");
|
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionPrec2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountMinus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric(18,6)",
|
|
||||||
precision: 18,
|
|
||||||
scale: 6,
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric(6,0)",
|
|
||||||
oldPrecision: 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountMinus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric(6,0)",
|
|
||||||
precision: 6,
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric(18,6)",
|
|
||||||
oldPrecision: 18,
|
|
||||||
oldScale: 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class MotionPrec3 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountPlus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric(18,6)",
|
|
||||||
precision: 18,
|
|
||||||
scale: 6,
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<decimal>(
|
|
||||||
name: "AmountPlus",
|
|
||||||
table: "AccountMotions",
|
|
||||||
type: "numeric",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(decimal),
|
|
||||||
oldType: "numeric(18,6)",
|
|
||||||
oldPrecision: 18,
|
|
||||||
oldScale: 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+33
-33
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace MyOffice.Migrations.Postgres.Migrations
|
namespace MyOffice.Migrations.Postgres.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AppDbContext))]
|
[DbContext(typeof(AppDbContext))]
|
||||||
[Migration("20230621083446_MotionPrec3")]
|
[Migration("20230621190024_Init")]
|
||||||
partial class MotionPrec3
|
partial class Init
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -122,7 +122,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.ToTable("AccountCategories");
|
b.ToTable("AccountCategories");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Motion", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -148,7 +148,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
b.Property<int>("ItemId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
b.Property<Guid?>("UserId")
|
||||||
@@ -158,11 +158,11 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasIndex("AccountId");
|
b.HasIndex("AccountId");
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
b.HasIndex("ItemId");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
b.ToTable("Motions");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
||||||
@@ -243,7 +243,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.ToTable("CurrencyRates");
|
b.ToTable("CurrencyRates");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -254,19 +254,19 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Property<Guid>("CategoryId")
|
b.Property<Guid>("CategoryId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
b.Property<Guid>("ItemGlobalId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
b.HasIndex("CategoryId");
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
b.HasIndex("ItemGlobalId");
|
||||||
|
|
||||||
b.ToTable("Motions");
|
b.ToTable("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -283,10 +283,10 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
b.ToTable("ItemCategories");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemGlobal", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -298,7 +298,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
b.ToTable("ItemGlobals");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
||||||
@@ -442,7 +442,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Motion", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
||||||
.WithMany("Motions")
|
.WithMany("Motions")
|
||||||
@@ -450,9 +450,9 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
b.HasOne("MyOffice.Data.Models.Motions.Item", "Item")
|
||||||
.WithMany("Motions")
|
.WithMany("Motions")
|
||||||
.HasForeignKey("MotionId")
|
.HasForeignKey("ItemId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
@@ -462,7 +462,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.Navigation("Account");
|
b.Navigation("Account");
|
||||||
|
|
||||||
b.Navigation("Motion");
|
b.Navigation("Item");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
||||||
@@ -495,29 +495,29 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("Currency");
|
b.Navigation("Currency");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
b.HasOne("MyOffice.Data.Models.Motions.ItemCategory", "Category")
|
||||||
.WithMany("Motions")
|
.WithMany("Items")
|
||||||
.HasForeignKey("CategoryId")
|
.HasForeignKey("CategoryId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
b.HasOne("MyOffice.Data.Models.Motions.ItemGlobal", "ItemGlobal")
|
||||||
.WithMany("Motions")
|
.WithMany("Items")
|
||||||
.HasForeignKey("MotionGlobalId")
|
.HasForeignKey("ItemGlobalId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("Category");
|
b.Navigation("Category");
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
b.Navigation("ItemGlobal");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
||||||
.WithMany("MotionCategories")
|
.WithMany("ItemCategories")
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@@ -573,19 +573,19 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("Currencies");
|
b.Navigation("Currencies");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Motions");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemGlobal", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
||||||
@@ -598,7 +598,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.Navigation("Currencies");
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
b.Navigation("ItemCategories");
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
b.Navigation("UserClaims");
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,445 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MyOffice.Migrations.Postgres.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Init : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterDatabase()
|
||||||
|
.Annotation("Npgsql:CollationDefinition:my_ci_collation", "en-u-ks-primary,en-u-ks-primary,icu,False");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CurrencyGlobals",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Symbol = table.Column<string>(type: "text", nullable: false),
|
||||||
|
DefaultQuantity = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CurrencyGlobals", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ItemGlobals",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ItemGlobals", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Accounts",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
CurrencyGlobalId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Accounts", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Accounts_CurrencyGlobals_CurrencyGlobalId",
|
||||||
|
column: x => x.CurrencyGlobalId,
|
||||||
|
principalTable: "CurrencyGlobals",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Users",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
UserName = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
||||||
|
Email = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
||||||
|
PasswordHash = table.Column<string>(type: "text", nullable: false),
|
||||||
|
FirstName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
LastName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
FullName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
Phone = table.Column<string>(type: "text", nullable: true),
|
||||||
|
IsEmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
CurrencyId = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Users", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Users_CurrencyGlobals_CurrencyId",
|
||||||
|
column: x => x.CurrencyId,
|
||||||
|
principalTable: "CurrencyGlobals",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AccountAccesses",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
IsAllowRead = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
IsAllowWrite = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
IsAllowManage = table.Column<bool>(type: "boolean", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AccountAccesses", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AccountAccesses_Accounts_AccountId",
|
||||||
|
column: x => x.AccountId,
|
||||||
|
principalTable: "Accounts",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AccountAccesses_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AccountCategories",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AccountCategories", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AccountCategories_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Currencies",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
CurrencyGlobalId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ShortName = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Currencies", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Currencies_CurrencyGlobals_CurrencyGlobalId",
|
||||||
|
column: x => x.CurrencyGlobalId,
|
||||||
|
principalTable: "CurrencyGlobals",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Currencies_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ItemCategories",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ItemCategories", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ItemCategories_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserClaims",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ExternalId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Email = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation"),
|
||||||
|
Provider = table.Column<string>(type: "text", nullable: false, collation: "my_ci_collation")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserClaims", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserClaims_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AccountAccountCategories",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
CategoryId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AccountAccountCategories", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AccountAccountCategories_AccountCategories_CategoryId",
|
||||||
|
column: x => x.CategoryId,
|
||||||
|
principalTable: "AccountCategories",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AccountAccountCategories_Accounts_AccountId",
|
||||||
|
column: x => x.AccountId,
|
||||||
|
principalTable: "Accounts",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CurrencyRates",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
CurrencyId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
Quantity = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
Rate = table.Column<decimal>(type: "numeric", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CurrencyRates", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CurrencyRates_Currencies_CurrencyId",
|
||||||
|
column: x => x.CurrencyId,
|
||||||
|
principalTable: "Currencies",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Items",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
CategoryId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ItemGlobalId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Items", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Items_ItemCategories_CategoryId",
|
||||||
|
column: x => x.CategoryId,
|
||||||
|
principalTable: "ItemCategories",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Items_ItemGlobals_ItemGlobalId",
|
||||||
|
column: x => x.ItemGlobalId,
|
||||||
|
principalTable: "ItemGlobals",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Motions",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
CreatedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
DateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
AccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ItemId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
Description = table.Column<string>(type: "text", nullable: true),
|
||||||
|
AmountPlus = table.Column<decimal>(type: "numeric(18,6)", precision: 18, scale: 6, nullable: false),
|
||||||
|
AmountMinus = table.Column<decimal>(type: "numeric(18,6)", precision: 18, scale: 6, nullable: false),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Motions", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Motions_Accounts_AccountId",
|
||||||
|
column: x => x.AccountId,
|
||||||
|
principalTable: "Accounts",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Motions_Items_ItemId",
|
||||||
|
column: x => x.ItemId,
|
||||||
|
principalTable: "Items",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Motions_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AccountAccesses_AccountId",
|
||||||
|
table: "AccountAccesses",
|
||||||
|
column: "AccountId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AccountAccesses_UserId",
|
||||||
|
table: "AccountAccesses",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AccountAccountCategories_AccountId",
|
||||||
|
table: "AccountAccountCategories",
|
||||||
|
column: "AccountId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AccountAccountCategories_CategoryId",
|
||||||
|
table: "AccountAccountCategories",
|
||||||
|
column: "CategoryId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_AccountCategories_UserId",
|
||||||
|
table: "AccountCategories",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Accounts_CurrencyGlobalId",
|
||||||
|
table: "Accounts",
|
||||||
|
column: "CurrencyGlobalId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Currencies_CurrencyGlobalId",
|
||||||
|
table: "Currencies",
|
||||||
|
column: "CurrencyGlobalId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Currencies_UserId",
|
||||||
|
table: "Currencies",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CurrencyRates_CurrencyId",
|
||||||
|
table: "CurrencyRates",
|
||||||
|
column: "CurrencyId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ItemCategories_UserId",
|
||||||
|
table: "ItemCategories",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Items_CategoryId",
|
||||||
|
table: "Items",
|
||||||
|
column: "CategoryId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Items_ItemGlobalId",
|
||||||
|
table: "Items",
|
||||||
|
column: "ItemGlobalId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Motions_AccountId",
|
||||||
|
table: "Motions",
|
||||||
|
column: "AccountId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Motions_ItemId",
|
||||||
|
table: "Motions",
|
||||||
|
column: "ItemId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Motions_UserId",
|
||||||
|
table: "Motions",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserClaims_UserId",
|
||||||
|
table: "UserClaims",
|
||||||
|
column: "UserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Users_CurrencyId",
|
||||||
|
table: "Users",
|
||||||
|
column: "CurrencyId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AccountAccesses");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AccountAccountCategories");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CurrencyRates");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Motions");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UserClaims");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AccountCategories");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Currencies");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Accounts");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Items");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ItemCategories");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ItemGlobals");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CurrencyGlobals");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -119,7 +119,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.ToTable("AccountCategories");
|
b.ToTable("AccountCategories");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Motion", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -145,7 +145,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("MotionId")
|
b.Property<int>("ItemId")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<Guid?>("UserId")
|
b.Property<Guid?>("UserId")
|
||||||
@@ -155,11 +155,11 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasIndex("AccountId");
|
b.HasIndex("AccountId");
|
||||||
|
|
||||||
b.HasIndex("MotionId");
|
b.HasIndex("ItemId");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("AccountMotions");
|
b.ToTable("Motions");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
||||||
@@ -240,7 +240,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.ToTable("CurrencyRates");
|
b.ToTable("CurrencyRates");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -251,19 +251,19 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Property<Guid>("CategoryId")
|
b.Property<Guid>("CategoryId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid>("MotionGlobalId")
|
b.Property<Guid>("ItemGlobalId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("CategoryId");
|
b.HasIndex("CategoryId");
|
||||||
|
|
||||||
b.HasIndex("MotionGlobalId");
|
b.HasIndex("ItemGlobalId");
|
||||||
|
|
||||||
b.ToTable("Motions");
|
b.ToTable("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -280,10 +280,10 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("MotionCategories");
|
b.ToTable("ItemCategories");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemGlobal", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -295,7 +295,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("GlobalMotions");
|
b.ToTable("ItemGlobals");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
||||||
@@ -439,7 +439,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Accounts.AccountMotion", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Accounts.Motion", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
b.HasOne("MyOffice.Data.Models.Accounts.Account", "Account")
|
||||||
.WithMany("Motions")
|
.WithMany("Motions")
|
||||||
@@ -447,9 +447,9 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionAccount", "Motion")
|
b.HasOne("MyOffice.Data.Models.Motions.Item", "Item")
|
||||||
.WithMany("Motions")
|
.WithMany("Motions")
|
||||||
.HasForeignKey("MotionId")
|
.HasForeignKey("ItemId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.Navigation("Account");
|
b.Navigation("Account");
|
||||||
|
|
||||||
b.Navigation("Motion");
|
b.Navigation("Item");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Currencies.Currency", b =>
|
||||||
@@ -492,29 +492,29 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("Currency");
|
b.Navigation("Currency");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionCategory", "Category")
|
b.HasOne("MyOffice.Data.Models.Motions.ItemCategory", "Category")
|
||||||
.WithMany("Motions")
|
.WithMany("Items")
|
||||||
.HasForeignKey("CategoryId")
|
.HasForeignKey("CategoryId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("MyOffice.Data.Models.Motions.MotionGlobal", "MotionGlobal")
|
b.HasOne("MyOffice.Data.Models.Motions.ItemGlobal", "ItemGlobal")
|
||||||
.WithMany("Motions")
|
.WithMany("Items")
|
||||||
.HasForeignKey("MotionGlobalId")
|
.HasForeignKey("ItemGlobalId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("Category");
|
b.Navigation("Category");
|
||||||
|
|
||||||
b.Navigation("MotionGlobal");
|
b.Navigation("ItemGlobal");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
||||||
.WithMany("MotionCategories")
|
.WithMany("ItemCategories")
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@@ -570,19 +570,19 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
b.Navigation("Currencies");
|
b.Navigation("Currencies");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionAccount", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.Item", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Motions");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionCategory", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemCategory", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Motions.MotionGlobal", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Motions.ItemGlobal", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Motions");
|
b.Navigation("Items");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
||||||
@@ -595,7 +595,7 @@ namespace MyOffice.Migrations.Postgres.Migrations
|
|||||||
|
|
||||||
b.Navigation("Currencies");
|
b.Navigation("Currencies");
|
||||||
|
|
||||||
b.Navigation("MotionCategories");
|
b.Navigation("ItemCategories");
|
||||||
|
|
||||||
b.Navigation("UserClaims");
|
b.Navigation("UserClaims");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
namespace MyOffice.Migrations;
|
namespace MyOffice.Migrations.Sqlite;
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
using Microsoft.EntityFrameworkCore.Design;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using DbContext;
|
using MyOffice.DbContext;
|
||||||
using Shared;
|
using MyOffice.Shared;
|
||||||
|
|
||||||
public class AppDbContextFactorySqlite : IDesignTimeDbContextFactory<AppDbContext>
|
public class AppDbContextFactorySqlite : IDesignTimeDbContextFactory<AppDbContext>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Sqlite.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230408180122_init")]
|
|
||||||
partial class init
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.0");
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Sqlite.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class init : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Users",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
||||||
UserName = table.Column<string>(type: "TEXT", nullable: false, collation: "NOCASE"),
|
|
||||||
Email = table.Column<string>(type: "TEXT", nullable: false, collation: "NOCASE"),
|
|
||||||
PasswordHash = table.Column<string>(type: "TEXT", nullable: false),
|
|
||||||
FirstName = table.Column<string>(type: "TEXT", nullable: true),
|
|
||||||
LastName = table.Column<string>(type: "TEXT", nullable: true),
|
|
||||||
FullName = table.Column<string>(type: "TEXT", nullable: true),
|
|
||||||
IsEmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Users", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "UserClaims",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
|
||||||
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
||||||
UserId = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
||||||
ExternalId = table.Column<string>(type: "TEXT", nullable: false),
|
|
||||||
Email = table.Column<string>(type: "TEXT", nullable: false, collation: "NOCASE"),
|
|
||||||
Provider = table.Column<string>(type: "TEXT", nullable: false, collation: "NOCASE")
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_UserClaims", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_UserClaims_Users_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "Users",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_UserClaims_UserId",
|
|
||||||
table: "UserClaims",
|
|
||||||
column: "UserId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "UserClaims");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Sqlite.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20230408180149_phone")]
|
|
||||||
partial class phone
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.0");
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Sqlite.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class phone : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "Phone",
|
|
||||||
table: "Users",
|
|
||||||
type: "TEXT",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Phone",
|
|
||||||
table: "Users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using MyOffice.DbContext;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace MyOffice.Migrations.Sqlite.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
partial class AppDbContextModelSnapshot : ModelSnapshot
|
|
||||||
{
|
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.0");
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("FullName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEmailConfirmed")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Phone")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedOn")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<string>("ExternalId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Provider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.UseCollation("NOCASE");
|
|
||||||
|
|
||||||
b.Property<Guid>("UserId")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("UserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.UserExternal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MyOffice.Data.Models.Users.User", "User")
|
|
||||||
.WithMany("UserClaims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MyOffice.Data.Models.Users.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("UserClaims");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
<ProjectReference Include="..\MyOffice.Shared\MyOffice.Shared.csproj" />
|
<ProjectReference Include="..\MyOffice.Shared\MyOffice.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Migrations\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ export class ApiRoutes {
|
|||||||
static SettingsAccount = '/api/settings/accounts/:id';
|
static SettingsAccount = '/api/settings/accounts/:id';
|
||||||
static SettingsAccountAccountCategory = '/api/settings/accounts/:id/category/:categoryId';
|
static SettingsAccountAccountCategory = '/api/settings/accounts/:id/category/:categoryId';
|
||||||
|
|
||||||
static SettingsMotionCategories = '/api/settings/motion-categories';
|
static SettingsItemCategories = '/api/settings/item-categories';
|
||||||
static SettingsMotionCategory = '/api/settings/motion-categories/:id';
|
static SettingsItemCategory = '/api/settings/item-categories/:id';
|
||||||
|
|
||||||
static SettingsMotions = '/api/settings/motions';
|
static SettingsItems = '/api/settings/items';
|
||||||
static SettingsMotion = '/api/settings/motions/:id';
|
static SettingsItem = '/api/settings/items/:id';
|
||||||
|
|
||||||
static Accounts = '/api/accounts';
|
static Accounts = '/api/accounts';
|
||||||
static Account = '/api/accounts/:id';
|
static Account = '/api/accounts/:id';
|
||||||
|
|||||||
@@ -229,8 +229,8 @@ export const ROUTES: RouteInfo[] = [
|
|||||||
submenu: [],
|
submenu: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/settings/motion-categories',
|
path: '/settings/item-categories',
|
||||||
title: 'Motion categories',
|
title: 'Item categories',
|
||||||
iconType: '',
|
iconType: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
class: 'ml-menu',
|
class: 'ml-menu',
|
||||||
@@ -240,8 +240,8 @@ export const ROUTES: RouteInfo[] = [
|
|||||||
submenu: [],
|
submenu: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/settings/motions',
|
path: '/settings/items',
|
||||||
title: 'Motions',
|
title: 'Items',
|
||||||
iconType: '',
|
iconType: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
class: 'ml-menu',
|
class: 'ml-menu',
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export interface MotionCategoryModel {
|
export interface ItemCategoryModel {
|
||||||
id?: string,
|
id?: string,
|
||||||
name?: string,
|
name?: string,
|
||||||
allowDelete: boolean,
|
allowDelete: boolean,
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export interface MotionModel {
|
export interface ItemModel {
|
||||||
id?: string,
|
id?: string,
|
||||||
name?: string,
|
name?: string,
|
||||||
categoryId?: string,
|
categoryId?: string,
|
||||||
@@ -4,9 +4,9 @@ import { UserProfileComponent } from './user-profile/user-profile.component';
|
|||||||
import { SettingsCurrencyComponent } from './settings/currency/currency.component';
|
import { SettingsCurrencyComponent } from './settings/currency/currency.component';
|
||||||
import { SettingsAccountCategoryComponent } from './settings/account/account.category.component';
|
import { SettingsAccountCategoryComponent } from './settings/account/account.category.component';
|
||||||
import { SettingsAccountComponent } from './settings/account/account.component';
|
import { SettingsAccountComponent } from './settings/account/account.component';
|
||||||
import { SettingsMotionCategoryComponent } from './settings/motion/motion.category.component';
|
import { SettingsItemCategoryComponent } from './settings/item/item.category.component';
|
||||||
import { SettingsMotionComponent } from './settings/motion/motion.component';
|
import { SettingsItemComponent } from './settings/item/item.component';
|
||||||
import { AccountListComponent as AccountComponent } from './accounts/account.list.component';
|
import { AccountListComponent } from './accounts/account.list.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -31,16 +31,16 @@ const routes: Routes = [
|
|||||||
component: SettingsAccountComponent,
|
component: SettingsAccountComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'settings/motion-categories',
|
path: 'settings/item-categories',
|
||||||
component: SettingsMotionCategoryComponent,
|
component: SettingsItemCategoryComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'settings/motions',
|
path: 'settings/items',
|
||||||
component: SettingsMotionComponent,
|
component: SettingsItemComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'account-category/:id',
|
path: 'account-category/:id',
|
||||||
component: AccountComponent,
|
component: AccountListComponent,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import { SettingsAccountComponent } from './settings/account/account.component';
|
|||||||
import { SettingsAccountAddComponent } from './settings/account/add.account.component';
|
import { SettingsAccountAddComponent } from './settings/account/add.account.component';
|
||||||
import { SettingsAccountEditComponent } from './settings/account/edit.account.component';
|
import { SettingsAccountEditComponent } from './settings/account/edit.account.component';
|
||||||
import { CurrencyService } from '../services/currency.service';
|
import { CurrencyService } from '../services/currency.service';
|
||||||
import { MotionService } from '../services/motion.service';
|
import { ItemService } from '../services/item.service';
|
||||||
import { SettingsMotionCategoryComponent } from './settings/motion/motion.category.component';
|
import { SettingsItemCategoryComponent } from './settings/item/item.category.component';
|
||||||
import { SettingsMotionComponent } from './settings/motion/motion.component';
|
import { SettingsItemComponent } from './settings/item/item.component';
|
||||||
import { SettingsMotionEditComponent } from './settings/motion/edit.motion.component';
|
import { SettingsItemEditComponent } from './settings/item/edit.item.component';
|
||||||
import { AccountListComponent } from './accounts/account.list.component';
|
import { AccountListComponent } from './accounts/account.list.component';
|
||||||
import { AccountComponent } from './accounts/account.component';
|
import { AccountComponent } from './accounts/account.component';
|
||||||
import { MotionComponent } from './accounts/motion.component';
|
import { MotionComponent } from './accounts/motion.component';
|
||||||
@@ -53,9 +53,9 @@ import { MotionComponent } from './accounts/motion.component';
|
|||||||
SettingsAccountAddComponent,
|
SettingsAccountAddComponent,
|
||||||
SettingsAccountEditComponent,
|
SettingsAccountEditComponent,
|
||||||
|
|
||||||
SettingsMotionCategoryComponent,
|
SettingsItemCategoryComponent,
|
||||||
SettingsMotionComponent,
|
SettingsItemComponent,
|
||||||
SettingsMotionEditComponent,
|
SettingsItemEditComponent,
|
||||||
|
|
||||||
AccountListComponent,
|
AccountListComponent,
|
||||||
AccountComponent,
|
AccountComponent,
|
||||||
@@ -84,7 +84,7 @@ import { MotionComponent } from './accounts/motion.component';
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },
|
||||||
CurrencyService,
|
CurrencyService,
|
||||||
MotionService,
|
ItemService,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class PagesModule {
|
export class PagesModule {
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
<div class="text-inside">
|
<div class="text-inside">
|
||||||
<mat-form-field class="example-full-width">
|
<mat-form-field class="example-full-width">
|
||||||
<mat-label>Name</mat-label>
|
<mat-label>Name</mat-label>
|
||||||
<input matInput value={{motion.name}} formControlName="name" readonly>
|
<input matInput value={{item.name}} formControlName="name" readonly>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
+15
-16
@@ -7,50 +7,49 @@ import { UntypedFormGroup } from '@angular/forms';
|
|||||||
import { Validators } from '@angular/forms';
|
import { Validators } from '@angular/forms';
|
||||||
|
|
||||||
// libs
|
// libs
|
||||||
import Swal from 'sweetalert2';
|
|
||||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
|
|
||||||
// app
|
// app
|
||||||
import { ApiRoutes } from '../../../api-routes';
|
import { ApiRoutes } from '../../../api-routes';
|
||||||
import { MatDialogRef } from '@angular/material/dialog';
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
import { AccountCategoryModel } from '../../../model/account.category.model';
|
import { ItemCategoryModel } from '../../../model/item.category.model';
|
||||||
import { MotionModel } from '../../../model/motion.model';
|
import { ItemModel } from '../../../model/item.model';
|
||||||
import { MotionService } from '../../../services/motion.service';
|
import { ItemService } from '../../../services/item.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './edit.motion.component.html',
|
templateUrl: './edit.item.component.html',
|
||||||
styleUrls: ['./edit.motion.component.scss'],
|
styleUrls: ['./edit.item.component.scss'],
|
||||||
})
|
})
|
||||||
export class SettingsMotionEditComponent {
|
export class SettingsItemEditComponent {
|
||||||
public editForm!: UntypedFormGroup;
|
public editForm!: UntypedFormGroup;
|
||||||
public errorMessage?: string;
|
public errorMessage?: string;
|
||||||
public categories?: AccountCategoryModel[];
|
public categories?: ItemCategoryModel[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private dialogRef: MatDialogRef<SettingsMotionEditComponent>,
|
private dialogRef: MatDialogRef<SettingsItemEditComponent>,
|
||||||
private motionService: MotionService,
|
private itemService: ItemService,
|
||||||
@Inject(MAT_DIALOG_DATA) public motion: MotionModel
|
@Inject(MAT_DIALOG_DATA) public item: ItemModel
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.editForm = this.fb.group({
|
this.editForm = this.fb.group({
|
||||||
id: [
|
id: [
|
||||||
this.motion.id,
|
this.item.id,
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
this.motion.name,
|
this.item.name,
|
||||||
[Validators.required],
|
[Validators.required],
|
||||||
],
|
],
|
||||||
category: [
|
category: [
|
||||||
this.motion.categoryId,
|
this.item.categoryId,
|
||||||
[Validators.required],
|
[Validators.required],
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.motionService
|
this.itemService
|
||||||
.getCategories()
|
.getCategories()
|
||||||
.subscribe(x => this.categories = x);
|
.subscribe(x => this.categories = x);
|
||||||
}
|
}
|
||||||
@@ -63,7 +62,7 @@ export class SettingsMotionEditComponent {
|
|||||||
if (this.editForm.valid) {
|
if (this.editForm.valid) {
|
||||||
this.errorMessage = undefined;
|
this.errorMessage = undefined;
|
||||||
this.httpClient
|
this.httpClient
|
||||||
.put<MotionModel>(ApiRoutes.SettingsMotion.replace(':id', this.motion.id!), this.editForm.value)
|
.put<ItemModel>(ApiRoutes.SettingsItem.replace(':id', this.item.id!), this.editForm.value)
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
this.dialogRef.close({ motion: response, refresh: true });
|
this.dialogRef.close({ motion: response, refresh: true });
|
||||||
}, error => {
|
}, error => {
|
||||||
+14
-14
@@ -7,14 +7,14 @@ import Swal from 'sweetalert2';
|
|||||||
|
|
||||||
// app
|
// app
|
||||||
import { ApiRoutes } from '../../../api-routes';
|
import { ApiRoutes } from '../../../api-routes';
|
||||||
import { MotionCategoryModel } from '../../../model/motion.category.model';
|
import { ItemCategoryModel } from '../../../model/item.category.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './motion.category.component.html',
|
templateUrl: './item.category.component.html',
|
||||||
styleUrls: ['./motion.category.component.scss'],
|
styleUrls: ['./item.category.component.scss'],
|
||||||
})
|
})
|
||||||
export class SettingsMotionCategoryComponent {
|
export class SettingsItemCategoryComponent {
|
||||||
public categories?: MotionCategoryModel[];
|
public categories?: ItemCategoryModel[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
@@ -27,7 +27,7 @@ export class SettingsMotionCategoryComponent {
|
|||||||
|
|
||||||
private load() {
|
private load() {
|
||||||
this.httpClient
|
this.httpClient
|
||||||
.get<MotionCategoryModel[]>(ApiRoutes.SettingsMotionCategories)
|
.get<ItemCategoryModel[]>(ApiRoutes.SettingsItemCategories)
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.categories = data;
|
this.categories = data;
|
||||||
});
|
});
|
||||||
@@ -35,7 +35,7 @@ export class SettingsMotionCategoryComponent {
|
|||||||
|
|
||||||
public add() {
|
public add() {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Motion category name',
|
title: 'Item category name',
|
||||||
input: 'text',
|
input: 'text',
|
||||||
inputAttributes: {
|
inputAttributes: {
|
||||||
autocapitalize: 'off',
|
autocapitalize: 'off',
|
||||||
@@ -45,7 +45,7 @@ export class SettingsMotionCategoryComponent {
|
|||||||
showLoaderOnConfirm: true,
|
showLoaderOnConfirm: true,
|
||||||
preConfirm: (name) => {
|
preConfirm: (name) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.httpClient.post(ApiRoutes.SettingsMotionCategories, { name: name })
|
this.httpClient.post(ApiRoutes.SettingsItemCategories, { name: name })
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}, error => {
|
}, error => {
|
||||||
@@ -63,9 +63,9 @@ export class SettingsMotionCategoryComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public edit(category: MotionCategoryModel) {
|
public edit(category: ItemCategoryModel) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Motion category name',
|
title: 'Item category name',
|
||||||
input: 'text',
|
input: 'text',
|
||||||
inputValue: category.name,
|
inputValue: category.name,
|
||||||
inputAttributes: {
|
inputAttributes: {
|
||||||
@@ -76,7 +76,7 @@ export class SettingsMotionCategoryComponent {
|
|||||||
showLoaderOnConfirm: true,
|
showLoaderOnConfirm: true,
|
||||||
preConfirm: (name) => {
|
preConfirm: (name) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.httpClient.put(ApiRoutes.SettingsMotionCategory.replace(':id', category.id!), { name: name })
|
this.httpClient.put(ApiRoutes.SettingsItemCategory.replace(':id', category.id!), { name: name })
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}, error => {
|
}, error => {
|
||||||
@@ -94,15 +94,15 @@ export class SettingsMotionCategoryComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public remove(category: MotionCategoryModel) {
|
public remove(category: ItemCategoryModel) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Remove motion category ' + category.name,
|
title: 'Remove item category ' + category.name,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonText: 'Delete',
|
confirmButtonText: 'Delete',
|
||||||
showLoaderOnConfirm: true,
|
showLoaderOnConfirm: true,
|
||||||
preConfirm: (name) => {
|
preConfirm: (name) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.httpClient.delete(ApiRoutes.SettingsMotionCategory.replace(':id', category.id!))
|
this.httpClient.delete(ApiRoutes.SettingsItemCategory.replace(':id', category.id!))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}, error => {
|
}, error => {
|
||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
<div class="content-block">
|
<div class="content-block">
|
||||||
<div class="block-header">
|
<div class="block-header">
|
||||||
<!-- breadcrumb -->
|
<!-- breadcrumb -->
|
||||||
<app-breadcrumb [title]="'Blank'" [items]="['Home','Settings']" [active_item]="'Motions'">
|
<app-breadcrumb [title]="'Blank'" [items]="['Home','Settings']" [active_item]="'Items'">
|
||||||
</app-breadcrumb>
|
</app-breadcrumb>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="body table-responsive">
|
<div class="body table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let item of motions">
|
<tr *ngFor="let item of items">
|
||||||
<td>{{item.name}}</td>
|
<td>{{item.name}}</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn-space" (click)="edit(item)" mat-raised-button color="primary">
|
<button class="btn-space" (click)="edit(item)" mat-raised-button color="primary">
|
||||||
+21
-21
@@ -8,24 +8,24 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
|
|
||||||
// app
|
// app
|
||||||
import { ApiRoutes } from '../../../api-routes';
|
import { ApiRoutes } from '../../../api-routes';
|
||||||
import { SettingsMotionEditComponent } from './edit.motion.component';
|
import { SettingsItemEditComponent } from './edit.item.component';
|
||||||
import { MotionService } from '../../../services/motion.service';
|
import { ItemService } from '../../../services/item.service';
|
||||||
import { MotionModel } from '../../../model/motion.model';
|
import { ItemModel } from '../../../model/item.model';
|
||||||
import { MotionCategoryModel } from '../../../model/motion.category.model';
|
import { ItemCategoryModel } from '../../../model/item.category.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './motion.component.html',
|
templateUrl: './item.component.html',
|
||||||
styleUrls: ['./motion.component.scss'],
|
styleUrls: ['./item.component.scss'],
|
||||||
})
|
})
|
||||||
export class SettingsMotionComponent {
|
export class SettingsItemComponent {
|
||||||
public motions?: MotionModel[];
|
public items?: ItemModel[];
|
||||||
public categories?: MotionCategoryModel[];
|
public categories?: ItemCategoryModel[];
|
||||||
public selectedCategory?: MotionCategoryModel;
|
public selectedCategory?: ItemCategoryModel;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private dialogModel: MatDialog,
|
private dialogModel: MatDialog,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private motionService: MotionService,
|
private itemService: ItemService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export class SettingsMotionComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private load(categoryId?: string) {
|
private load(categoryId?: string) {
|
||||||
this.motionService.getCategories()
|
this.itemService.getCategories()
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.categories = data;
|
this.categories = data;
|
||||||
var selected = data[0];
|
var selected = data[0];
|
||||||
@@ -49,19 +49,19 @@ export class SettingsMotionComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public selectCategory(category: MotionCategoryModel) {
|
public selectCategory(category: ItemCategoryModel) {
|
||||||
this.selectedCategory = category;
|
this.selectedCategory = category;
|
||||||
this.motionService.getMotions(category.id)
|
this.itemService.getItems(category.id)
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.motions = data;
|
this.items = data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public edit(motion: MotionModel) {
|
public edit(item: ItemModel) {
|
||||||
this.dialogModel.open(SettingsMotionEditComponent, {
|
this.dialogModel.open(SettingsItemEditComponent, {
|
||||||
width: '640px',
|
width: '640px',
|
||||||
disableClose: true,
|
disableClose: true,
|
||||||
data: motion,
|
data: item,
|
||||||
}).afterClosed().subscribe(x => {
|
}).afterClosed().subscribe(x => {
|
||||||
if (x && x.refresh) {
|
if (x && x.refresh) {
|
||||||
console.log(x.motion.categoryId);
|
console.log(x.motion.categoryId);
|
||||||
@@ -70,15 +70,15 @@ export class SettingsMotionComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public remove(category: MotionModel) {
|
public remove(category: ItemModel) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Remove motion ' + category.name,
|
title: 'Remove item from ' + category.name,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonText: 'Delete',
|
confirmButtonText: 'Delete',
|
||||||
showLoaderOnConfirm: true,
|
showLoaderOnConfirm: true,
|
||||||
preConfirm: (name) => {
|
preConfirm: (name) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.httpClient.delete(ApiRoutes.SettingsMotionCategory.replace(':id', category.id!))
|
this.httpClient.delete(ApiRoutes.SettingsItemCategory.replace(':id', category.id!))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}, error => {
|
}, error => {
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// angular
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
|
// libs
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
// app
|
||||||
|
import { ApiRoutes } from '../api-routes';
|
||||||
|
import { ItemModel } from '../model/item.model';
|
||||||
|
import { ItemCategoryModel } from '../model/item.category.model';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ItemService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private httpClient: HttpClient,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCategories(category?: string): Observable<ItemCategoryModel[]> {
|
||||||
|
return this.httpClient
|
||||||
|
.get<ItemCategoryModel[]>(ApiRoutes.SettingsItemCategories);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getItems(categoryId?: string): Observable<ItemModel[]> {
|
||||||
|
var url = categoryId
|
||||||
|
? ApiRoutes.SettingsItems + "?category=" + categoryId
|
||||||
|
: ApiRoutes.SettingsItems;
|
||||||
|
|
||||||
|
return this.httpClient
|
||||||
|
.get<ItemCategoryModel[]>(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
// angular
|
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
|
|
||||||
// libs
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
// app
|
|
||||||
import { ApiRoutes } from '../api-routes';
|
|
||||||
import { MotionModel } from '../model/motion.model';
|
|
||||||
import { AccountCategoryModel } from '../model/account.category.model';
|
|
||||||
import { MotionCategoryModel } from '../model/motion.category.model';
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class MotionService {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private httpClient: HttpClient,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public getCategories(category?: string): Observable<MotionCategoryModel[]> {
|
|
||||||
return this.httpClient
|
|
||||||
.get<MotionCategoryModel[]>(ApiRoutes.SettingsMotionCategories);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getMotions(categoryId?: string): Observable<MotionModel[]> {
|
|
||||||
var url = categoryId
|
|
||||||
? ApiRoutes.SettingsMotions + "?category=" + categoryId
|
|
||||||
: ApiRoutes.SettingsMotions;
|
|
||||||
|
|
||||||
return this.httpClient
|
|
||||||
.get<MotionCategoryModel[]>(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,23 +4,23 @@
|
|||||||
using Core.Extensions;
|
using Core.Extensions;
|
||||||
using Core.Helpers;
|
using Core.Helpers;
|
||||||
using Data.Models.Accounts;
|
using Data.Models.Accounts;
|
||||||
using Data.Models.Motions;
|
using Data.Models.Items;
|
||||||
using Data.Repositories.Account;
|
using Data.Repositories.Account;
|
||||||
using Data.Repositories.Currency;
|
using Data.Repositories.Currency;
|
||||||
using Data.Repositories.Motion;
|
using Data.Repositories.Item;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using MyOffice.Services.Account.Domain;
|
using MyOffice.Services.Account.Domain;
|
||||||
|
|
||||||
public class AccountService
|
public class AccountService
|
||||||
{
|
{
|
||||||
private ILogger<AccountService> _logger;
|
private ILogger<AccountService> _logger;
|
||||||
public readonly IAccountCategoryRepository _accountCategoryRepository;
|
private readonly IAccountCategoryRepository _accountCategoryRepository;
|
||||||
public readonly IAccountRepository _accountRepository;
|
private readonly IAccountRepository _accountRepository;
|
||||||
public readonly ICurrencyRepository _currencyRepository;
|
private readonly ICurrencyRepository _currencyRepository;
|
||||||
public readonly IAccountAccountCategoryRepository _accountAccountCategoryRepository;
|
private readonly IAccountAccountCategoryRepository _accountAccountCategoryRepository;
|
||||||
public readonly IAccountMotionRepository _accountMotionRepository;
|
private readonly IMotionRepository _motionRepository;
|
||||||
public readonly IMotionRepository _motionRepository;
|
private readonly IItemRepository _itemRepository;
|
||||||
public readonly IMotionGlobalRepository _motionGlobalRepository;
|
private readonly IItemGlobalRepository _motionGlobalRepository;
|
||||||
|
|
||||||
public AccountService(
|
public AccountService(
|
||||||
ILogger<AccountService> logger,
|
ILogger<AccountService> logger,
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
IAccountRepository accountRepository,
|
IAccountRepository accountRepository,
|
||||||
ICurrencyRepository currencyRepository,
|
ICurrencyRepository currencyRepository,
|
||||||
IAccountAccountCategoryRepository accountAccountCategoryRepository,
|
IAccountAccountCategoryRepository accountAccountCategoryRepository,
|
||||||
IAccountMotionRepository accountMotionRepository,
|
|
||||||
IMotionRepository motionRepository,
|
IMotionRepository motionRepository,
|
||||||
IMotionGlobalRepository motionGlobalRepository
|
IItemRepository itemRepository,
|
||||||
|
IItemGlobalRepository motionGlobalRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@@ -38,8 +38,8 @@
|
|||||||
_accountRepository = accountRepository;
|
_accountRepository = accountRepository;
|
||||||
_currencyRepository = currencyRepository;
|
_currencyRepository = currencyRepository;
|
||||||
_accountAccountCategoryRepository = accountAccountCategoryRepository;
|
_accountAccountCategoryRepository = accountAccountCategoryRepository;
|
||||||
_accountMotionRepository = accountMotionRepository;
|
|
||||||
_motionRepository = motionRepository;
|
_motionRepository = motionRepository;
|
||||||
|
_itemRepository = itemRepository;
|
||||||
_motionGlobalRepository = motionGlobalRepository;
|
_motionGlobalRepository = motionGlobalRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,84 +279,84 @@
|
|||||||
return result.Set(categories);
|
return result.Set(categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<AccountMotion, AccountMotionAddResult> AccountMotionAdd(
|
public Exec<Motion, MotionAddResult> MotionAdd(
|
||||||
Guid userId,
|
Guid userId,
|
||||||
Guid accountId,
|
Guid accountId,
|
||||||
AccountMotionAdd accountMotion
|
MotionAdd motion
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (accountMotion == null)
|
if (motion == null)
|
||||||
throw new ArgumentNullException(nameof(accountMotion));
|
throw new ArgumentNullException(nameof(motion));
|
||||||
if (accountMotion.Motion == null)
|
if (motion.Motion == null)
|
||||||
throw new ArgumentNullException(nameof(accountMotion.Motion));
|
throw new ArgumentNullException(nameof(motion.Motion));
|
||||||
|
|
||||||
var result = new Exec<AccountMotion, AccountMotionAddResult>(AccountMotionAddResult.success);
|
var result = new Exec<Motion, MotionAddResult>(MotionAddResult.success);
|
||||||
|
|
||||||
var account = _accountRepository.Get(userId, accountId);
|
var account = _accountRepository.Get(userId, accountId);
|
||||||
if (account == null)
|
if (account == null)
|
||||||
{
|
{
|
||||||
return result.Set(AccountMotionAddResult.account_not_found);
|
return result.Set(MotionAddResult.account_not_found);
|
||||||
}
|
}
|
||||||
|
|
||||||
var motionGlobal = _motionGlobalRepository.GetByName(accountMotion.Motion);
|
var motionGlobal = _motionGlobalRepository.GetByName(motion.Motion);
|
||||||
if (motionGlobal == null)
|
if (motionGlobal == null)
|
||||||
{
|
{
|
||||||
// add global motion
|
// add global motion
|
||||||
motionGlobal = new MotionGlobal
|
motionGlobal = new ItemGlobal
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
Name = accountMotion.Motion.Trim(),
|
Name = motion.Motion.Trim(),
|
||||||
};
|
};
|
||||||
if (!_motionGlobalRepository.Add(motionGlobal))
|
if (!_motionGlobalRepository.Add(motionGlobal))
|
||||||
{
|
{
|
||||||
return result.Set(AccountMotionAddResult.failure);
|
return result.Set(MotionAddResult.failure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var motionAccount = _motionRepository.GetByGlobal(userId, motionGlobal.Id);
|
var item = _itemRepository.GetByGlobal(userId, motionGlobal.Id);
|
||||||
if (motionAccount == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
// add motion account
|
// add item
|
||||||
motionAccount = new MotionAccount
|
item = new Item
|
||||||
{
|
{
|
||||||
CategoryId = userId,
|
CategoryId = userId,
|
||||||
MotionGlobalId = motionGlobal.Id,
|
ItemGlobalId = motionGlobal.Id,
|
||||||
};
|
};
|
||||||
_motionRepository.Add(motionAccount);
|
_itemRepository.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
var accountMotionDb = new AccountMotion
|
var motionDb = new Motion
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
CreatedOn = DateTime.UtcNow,
|
CreatedOn = DateTime.UtcNow,
|
||||||
DateTime = accountMotion.Date,
|
DateTime = motion.Date,
|
||||||
AccountId = account.Id,
|
AccountId = account.Id,
|
||||||
MotionId = motionAccount.Id,
|
ItemId = item.Id,
|
||||||
AmountPlus = accountMotion.Plus,
|
AmountPlus = motion.Plus,
|
||||||
AmountMinus = accountMotion.Minus,
|
AmountMinus = motion.Minus,
|
||||||
Description = accountMotion.Description,
|
Description = motion.Description,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!_accountMotionRepository.Add(accountMotionDb))
|
if (!_motionRepository.Add(motionDb))
|
||||||
{
|
{
|
||||||
return result.Set(AccountMotionAddResult.failure);
|
return result.Set(MotionAddResult.failure);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
motionAccount.MotionGlobal = motionGlobal;
|
item.ItemGlobal = motionGlobal;
|
||||||
accountMotionDb.Motion = motionAccount;
|
motionDb.Item = item;
|
||||||
|
|
||||||
return result.Set(accountMotionDb);
|
return result.Set(motionDb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<List<AccountMotion>, GeneralExecStatus> GetAccountMotion(
|
public Exec<List<Motion>, GeneralExecStatus> GetMotions(
|
||||||
Guid userId,
|
Guid userId,
|
||||||
Guid accountId,
|
Guid accountId,
|
||||||
DateTime dateFrom,
|
DateTime dateFrom,
|
||||||
DateTime dateTo
|
DateTime dateTo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
var result = new Exec<List<AccountMotion>, GeneralExecStatus>(GeneralExecStatus.success);
|
var result = new Exec<List<Motion>, GeneralExecStatus>(GeneralExecStatus.success);
|
||||||
|
|
||||||
var account = _accountRepository.Get(userId, accountId);
|
var account = _accountRepository.Get(userId, accountId);
|
||||||
if (account == null)
|
if (account == null)
|
||||||
@@ -364,7 +364,9 @@
|
|||||||
return result.Set(GeneralExecStatus.not_found);
|
return result.Set(GeneralExecStatus.not_found);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.Set(_accountMotionRepository.GetByAccount(accountId, dateFrom.ToUtc(), dateTo.ToUtc()));
|
var motions = _motionRepository.GetByAccount(accountId, dateFrom.ToUtc(), dateTo.ToUtc());
|
||||||
|
|
||||||
|
return result.Set(motions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
namespace MyOffice.Services.Account.Domain
|
namespace MyOffice.Services.Account.Domain
|
||||||
{
|
{
|
||||||
public class AccountMotionAdd
|
public class MotionAdd
|
||||||
{
|
{
|
||||||
public DateTime Date { get; set; }
|
public DateTime Date { get; set; }
|
||||||
public string Motion { get; set; } = null!;
|
public string Motion { get; set; } = null!;
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
namespace MyOffice.Services.Account.Domain;
|
namespace MyOffice.Services.Account.Domain;
|
||||||
|
|
||||||
public enum AccountMotionAddResult
|
public enum MotionAddResult
|
||||||
{
|
{
|
||||||
success,
|
success,
|
||||||
failure,
|
failure,
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace MyOffice.Services.Item.Domain
|
||||||
|
{
|
||||||
|
public enum ItemCategoryRemoveResult
|
||||||
|
{
|
||||||
|
success,
|
||||||
|
failure,
|
||||||
|
not_found,
|
||||||
|
accounts_exists,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +1,21 @@
|
|||||||
namespace MyOffice.Services.Motion
|
namespace MyOffice.Services.Item
|
||||||
{
|
{
|
||||||
using MyOffice.Data.Repositories.Motion;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using Domain;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Data.Models.Motions;
|
|
||||||
using MyOffice.Core;
|
using MyOffice.Core;
|
||||||
using MyOffice.Services.Motion.Domain;
|
using MyOffice.Data.Models.Items;
|
||||||
|
using MyOffice.Data.Repositories.Item;
|
||||||
|
|
||||||
public class MotionService
|
public class ItemService
|
||||||
{
|
{
|
||||||
private readonly IMotionCategoryRepository _motionCategoryRepository;
|
private readonly IItemCategoryRepository _motionCategoryRepository;
|
||||||
private readonly IMotionRepository _motionRepository;
|
private readonly IItemRepository _motionRepository;
|
||||||
|
|
||||||
public MotionService(
|
public ItemService(
|
||||||
IMotionCategoryRepository motionCategoryRepository,
|
IItemCategoryRepository motionCategoryRepository,
|
||||||
IMotionRepository motionRepository
|
IItemRepository motionRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_motionCategoryRepository = motionCategoryRepository;
|
_motionCategoryRepository = motionCategoryRepository;
|
||||||
@@ -25,12 +23,12 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MotionCategory> GetAllCategories(Guid userId)
|
public List<ItemCategory> GetAllCategories(Guid userId)
|
||||||
{
|
{
|
||||||
var result = _motionCategoryRepository.GetAll(userId);
|
var result = _motionCategoryRepository.GetAll(userId);
|
||||||
if (result.All(x => x.Id != userId))
|
if (result.All(x => x.Id != userId))
|
||||||
{
|
{
|
||||||
var category = new MotionCategory
|
var category = new ItemCategory
|
||||||
{
|
{
|
||||||
Id = userId,
|
Id = userId,
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
@@ -43,12 +41,12 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<MotionCategory, GeneralExecStatus> CategoryAdd(Guid userId, MotionCategory category)
|
public Exec<ItemCategory, GeneralExecStatus> CategoryAdd(Guid userId, ItemCategory category)
|
||||||
{
|
{
|
||||||
if (category == null)
|
if (category == null)
|
||||||
throw new ArgumentNullException(nameof(category));
|
throw new ArgumentNullException(nameof(category));
|
||||||
|
|
||||||
var result = new Exec<MotionCategory, GeneralExecStatus>(GeneralExecStatus.success);
|
var result = new Exec<ItemCategory, GeneralExecStatus>(GeneralExecStatus.success);
|
||||||
|
|
||||||
category.Id = Guid.NewGuid();
|
category.Id = Guid.NewGuid();
|
||||||
category.UserId = userId;
|
category.UserId = userId;
|
||||||
@@ -61,12 +59,12 @@
|
|||||||
return result.Set(category);
|
return result.Set(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<MotionCategory, GeneralExecStatus> CategoryUpdate(Guid userId, Guid id, MotionCategory category)
|
public Exec<ItemCategory, GeneralExecStatus> CategoryUpdate(Guid userId, Guid id, ItemCategory category)
|
||||||
{
|
{
|
||||||
if (category == null)
|
if (category == null)
|
||||||
throw new ArgumentNullException(nameof(category));
|
throw new ArgumentNullException(nameof(category));
|
||||||
|
|
||||||
var result = new Exec<MotionCategory, GeneralExecStatus>(GeneralExecStatus.success);
|
var result = new Exec<ItemCategory, GeneralExecStatus>(GeneralExecStatus.success);
|
||||||
|
|
||||||
var exists = _motionCategoryRepository.Get(userId, id);
|
var exists = _motionCategoryRepository.Get(userId, id);
|
||||||
if (exists == null)
|
if (exists == null)
|
||||||
@@ -84,41 +82,41 @@
|
|||||||
return result.Set(exists);
|
return result.Set(exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<MotionCategory, MotionCategoryRemoveResult> CategoryRemove(Guid userId, Guid id)
|
public Exec<ItemCategory, ItemCategoryRemoveResult> CategoryRemove(Guid userId, Guid id)
|
||||||
{
|
{
|
||||||
var result = new Exec<MotionCategory, MotionCategoryRemoveResult>(MotionCategoryRemoveResult.success);
|
var result = new Exec<ItemCategory, ItemCategoryRemoveResult>(ItemCategoryRemoveResult.success);
|
||||||
|
|
||||||
var exists = _motionCategoryRepository.Get(userId, id);
|
var exists = _motionCategoryRepository.Get(userId, id);
|
||||||
if (exists == null)
|
if (exists == null)
|
||||||
{
|
{
|
||||||
return result.Set(MotionCategoryRemoveResult.not_found);
|
return result.Set(ItemCategoryRemoveResult.not_found);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists.Motions.Any())
|
if (exists.Items.Any())
|
||||||
{
|
{
|
||||||
return result.Set(MotionCategoryRemoveResult.accounts_exists);
|
return result.Set(ItemCategoryRemoveResult.accounts_exists);
|
||||||
}
|
}
|
||||||
if (!_motionCategoryRepository.Remove(exists))
|
if (!_motionCategoryRepository.Remove(exists))
|
||||||
{
|
{
|
||||||
return result.Set(MotionCategoryRemoveResult.failure);
|
return result.Set(ItemCategoryRemoveResult.failure);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.Set(exists);
|
return result.Set(exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MotionAccount> GetAll(Guid userId)
|
public List<Item> GetAll(Guid userId)
|
||||||
{
|
{
|
||||||
return _motionRepository.GetAll(userId);
|
return _motionRepository.GetAll(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MotionAccount> GetByCategory(Guid userId, Guid categoryId)
|
public List<Item> GetByCategory(Guid userId, Guid categoryId)
|
||||||
{
|
{
|
||||||
return _motionRepository.GetByCategory(userId, categoryId);
|
return _motionRepository.GetByCategory(userId, categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exec<MotionAccount, GeneralExecStatus> Update(Guid userId, Guid motionId, Guid categoryId)
|
public Exec<Item, GeneralExecStatus> Update(Guid userId, Guid motionId, Guid categoryId)
|
||||||
{
|
{
|
||||||
var result = new Exec<MotionAccount, GeneralExecStatus>(GeneralExecStatus.success);
|
var result = new Exec<Item, GeneralExecStatus>(GeneralExecStatus.success);
|
||||||
|
|
||||||
var motion = _motionRepository.GetByGlobal(userId, motionId);
|
var motion = _motionRepository.GetByGlobal(userId, motionId);
|
||||||
if (motion == null)
|
if (motion == null)
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
namespace MyOffice.Services.Motion.Domain
|
|
||||||
{
|
|
||||||
public enum MotionCategoryRemoveResult
|
|
||||||
{
|
|
||||||
success,
|
|
||||||
failure,
|
|
||||||
not_found,
|
|
||||||
accounts_exists,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user