From c4c55bdf87aad0b108114a4b4fc3af1bde96b86b Mon Sep 17 00:00:00 2001 From: Iliyan Iliev Date: Wed, 1 Jul 2020 15:28:47 +0300 Subject: [PATCH] Closes #11 --- .../MAVN.Service.Campaign.Client.csproj | 6 +- ....Service.Campaign.AzureRepositories.csproj | 2 +- .../MAVN.Service.Campaign.Domain.csproj | 4 +- ...AVN.Service.Campaign.DomainServices.csproj | 8 +- .../AutofacModule.cs | 4 +- .../CampaignContext.cs | 6 +- .../Entities/BonusTypeEntity.cs | 2 +- .../Entities/BurnRuleEntity.cs | 2 +- .../Entities/CampaignEntity.cs | 8 +- .../Entities/ConditionEntity.cs | 8 +- ....Service.Campaign.MsSqlRepositories.csproj | 10 +- .../20190605071509_Initial.Designer.cs | 131 ------ .../Migrations/20190605071509_Initial.cs | 109 ----- ...0190628112730_AddConfiguration.Designer.cs | 144 ------- .../20190628112730_AddConfiguration.cs | 31 -- .../20190702143552_AddRules.Designer.cs | 262 ----------- .../Migrations/20190702143552_AddRules.cs | 122 ------ ...2143936_RenameEarnRuleContents.Designer.cs | 262 ----------- .../20190702143936_RenameEarnRuleContents.cs | 89 ---- ...09063332_RemoveSpendRuleEntity.Designer.cs | 236 ---------- .../20190709063332_RemoveSpendRuleEntity.cs | 89 ---- .../20190709132731_RenameTables.Designer.cs | 236 ---------- .../Migrations/20190709132731_RenameTables.cs | 176 -------- .../20190721212129_ConversionRate.Designer.cs | 242 ----------- .../20190721212129_ConversionRate.cs | 37 -- ...90820142424_BonusType_extended.Designer.cs | 251 ----------- .../20190820142424_BonusType_extended.cs | 48 --- ...1404_AddConditionPartnerEntity.Designer.cs | 278 ------------ ...0190822141404_AddConditionPartnerEntity.cs | 45 -- ...dPartnersAndVerticalToBurnRule.Designer.cs | 308 ------------- ...090554_AddPartnersAndVerticalToBurnRule.cs | 56 --- ...5101404_EarnRuleConversionRate.Designer.cs | 287 ------------- .../20190905101404_EarnRuleConversionRate.cs | 77 ---- .../20190924074638_Money18.Designer.cs | 329 -------------- .../Migrations/20190924074638_Money18.cs | 133 ------ ...5143609_AddStakingToConditions.Designer.cs | 347 --------------- .../20191015143609_AddStakingToConditions.cs | 81 ---- ..._RenameIsStackableInConditions.Designer.cs | 347 --------------- ...016103143_RenameIsStackableInConditions.cs | 25 -- ...TAddConversionRateInConditions.Designer.cs | 363 ---------------- ...HiddenInBTAddConversionRateInConditions.cs | 71 --- ...023053823_AddOrderToBonusTypes.Designer.cs | 366 ---------------- .../20191023053823_AddOrderToBonusTypes.cs | 25 -- ...3447_AddBurningRuleInCondition.Designer.cs | 369 ---------------- ...0191029153447_AddBurningRuleInCondition.cs | 24 -- ...06152812_AddConditionAttribute.Designer.cs | 402 ----------------- .../20191106152812_AddConditionAttribute.cs | 58 --- ...91202123500_AddApproximate\320\220ward.cs" | 51 --- ...AddOrderToCampaignAndBurnRules.Designer.cs | 375 ---------------- ...03140741_AddOrderToCampaignAndBurnRules.cs | 37 -- .../20191204072300_SpendRulePrice.Designer.cs | 405 ------------------ .../20191204072300_SpendRulePrice.cs | 24 -- .../20200701122228_Initial.Designer.cs | 249 +++++++---- .../Migrations/20200701122228_Initial.cs | 337 +++++++++++++++ .../CampaignContextModelSnapshot.cs | 246 +++++++---- .../Repositories/BonusTypeRepository.cs | 8 +- .../Repositories/BurnRuleContentRepository.cs | 8 +- .../Repositories/BurnRulePartnerRepository.cs | 8 +- .../Repositories/BurnRuleRepository.cs | 6 +- .../Repositories/CampaignRepository.cs | 6 +- .../Repositories/ConditionRepository.cs | 8 +- .../Repositories/ConfigurationRepository.cs | 8 +- .../Repositories/EarnRuleContentRepository.cs | 8 +- src/MAVN.Service.Campaign/Dockerfile | 2 +- .../MAVN.Service.Campaign.csproj | 8 +- ...ce.Campaign.MsSqlRepositories.Tests.csproj | 11 +- .../MAVN.Service.Campaign.Tests.csproj | 16 +- .../CampaignRepositoryTest.cs | 6 +- 68 files changed, 752 insertions(+), 7591 deletions(-) delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.cs delete mode 100644 "src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.cs" delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.Designer.cs delete mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.cs rename "src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.Designer.cs" => src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.Designer.cs (57%) create mode 100644 src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.cs diff --git a/client/MAVN.Service.Campaign.Client/MAVN.Service.Campaign.Client.csproj b/client/MAVN.Service.Campaign.Client/MAVN.Service.Campaign.Client.csproj index c2ab4c6..3e2c26f 100644 --- a/client/MAVN.Service.Campaign.Client/MAVN.Service.Campaign.Client.csproj +++ b/client/MAVN.Service.Campaign.Client/MAVN.Service.Campaign.Client.csproj @@ -14,10 +14,10 @@ - - + + - + \ No newline at end of file diff --git a/src/MAVN.Service.Campaign.AzureRepositories/MAVN.Service.Campaign.AzureRepositories.csproj b/src/MAVN.Service.Campaign.AzureRepositories/MAVN.Service.Campaign.AzureRepositories.csproj index 77cfaf9..d99ba5e 100644 --- a/src/MAVN.Service.Campaign.AzureRepositories/MAVN.Service.Campaign.AzureRepositories.csproj +++ b/src/MAVN.Service.Campaign.AzureRepositories/MAVN.Service.Campaign.AzureRepositories.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 1.0.0 diff --git a/src/MAVN.Service.Campaign.Domain/MAVN.Service.Campaign.Domain.csproj b/src/MAVN.Service.Campaign.Domain/MAVN.Service.Campaign.Domain.csproj index 6be2824..9cccd3c 100644 --- a/src/MAVN.Service.Campaign.Domain/MAVN.Service.Campaign.Domain.csproj +++ b/src/MAVN.Service.Campaign.Domain/MAVN.Service.Campaign.Domain.csproj @@ -1,12 +1,12 @@ - netcoreapp2.2 + netcoreapp3.1 1.0.0 - + diff --git a/src/MAVN.Service.Campaign.DomainServices/MAVN.Service.Campaign.DomainServices.csproj b/src/MAVN.Service.Campaign.DomainServices/MAVN.Service.Campaign.DomainServices.csproj index 1720dd9..fb3303b 100644 --- a/src/MAVN.Service.Campaign.DomainServices/MAVN.Service.Campaign.DomainServices.csproj +++ b/src/MAVN.Service.Campaign.DomainServices/MAVN.Service.Campaign.DomainServices.csproj @@ -1,14 +1,14 @@ - netcoreapp2.2 + netcoreapp3.1 1.0.0 latest - - - + + + diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/AutofacModule.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/AutofacModule.cs index 997e22a..0143412 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/AutofacModule.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/AutofacModule.cs @@ -1,5 +1,5 @@ using Autofac; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Repositories; using MAVN.Service.Campaign.MsSqlRepositories.Repositories; @@ -16,7 +16,7 @@ public AutofacModule(string connectionString) protected override void Load(ContainerBuilder builder) { - builder.RegisterMsSql( + builder.RegisterPostgreSQL( _connectionString, connString => new CampaignContext(connString, false), dbConn => new CampaignContext(dbConn)); diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/CampaignContext.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/CampaignContext.cs index 9b51d4b..f1be638 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/CampaignContext.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/CampaignContext.cs @@ -1,14 +1,14 @@ using System; using System.Data.Common; using JetBrains.Annotations; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.MsSqlRepositories.Entities; using MAVN.Service.PartnerManagement.Client.Models; using Microsoft.EntityFrameworkCore; namespace MAVN.Service.Campaign.MsSqlRepositories { - public class CampaignContext : MsSqlContext + public class CampaignContext : PostgreSQLContext { private const string Schema = "campaign"; @@ -45,7 +45,7 @@ public CampaignContext(DbConnection dbConnection) { } - protected override void OnLykkeModelCreating(ModelBuilder modelBuilder) + protected override void OnMAVNModelCreating(ModelBuilder modelBuilder) { //CampaignEntity modelBuilder.Entity() diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BonusTypeEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BonusTypeEntity.cs index c1bc2b5..4bb49d1 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BonusTypeEntity.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BonusTypeEntity.cs @@ -10,7 +10,7 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Entities public class BonusTypeEntity { [Key] - [Column("type", TypeName = "varchar(64)")] + [Column("type")] public string Type { get; set; } [Column("display_name")] diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BurnRuleEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BurnRuleEntity.cs index ee60839..d2447b6 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BurnRuleEntity.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/BurnRuleEntity.cs @@ -15,7 +15,7 @@ public class BurnRuleEntity : BaseEntity [Column("description")] public string Description { get; set; } - [Column("amount_in_tokens", TypeName = "nvarchar(64)")] + [Column("amount_in_tokens")] public Money18? AmountInTokens { get; set; } [Column("amount_in_currency")] diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/CampaignEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/CampaignEntity.cs index 69c9647..a381292 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/CampaignEntity.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/CampaignEntity.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using MAVN.Numerics; @@ -16,16 +16,16 @@ public class CampaignEntity : BaseEntity [Column("description")] public string Description { get; set; } - [Column("reward", TypeName = "nvarchar(64)")] + [Column("reward")] public Money18 Reward { get; set; } - [Column("approximate_reward", TypeName = "nvarchar(64)")] + [Column("approximate_reward")] public Money18? ApproximateAward { get; set; } [Column("reward_type")] public RewardType? RewardType { get; set; } - [Column("amount_in_tokens", TypeName = "nvarchar(64)")] + [Column("amount_in_tokens")] public Money18? AmountInTokens { get; set; } [Column("amount_in_currency")] diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/ConditionEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/ConditionEntity.cs index a360100..5be483c 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/ConditionEntity.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Entities/ConditionEntity.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using MAVN.Numerics; @@ -12,10 +12,10 @@ public class ConditionEntity : BaseEntity [Column("bonus_type")] public string BonusTypeName { get; set; } - [Column("immediate_reward", TypeName = "nvarchar(64)")] + [Column("immediate_reward")] public Money18 ImmediateReward { get; set; } - [Column("approximate_reward", TypeName = "nvarchar(64)")] + [Column("approximate_reward")] public Money18? ApproximateAward { get; set; } [Column("completion_count")] @@ -44,7 +44,7 @@ public class ConditionEntity : BaseEntity [Column("burning_rule")] public decimal? BurningRule { get; set; } - [Column("amount_in_tokens", TypeName = "nvarchar(64)")] + [Column("amount_in_tokens")] public Money18? AmountInTokens { get; set; } [Column("amount_in_currency")] diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/MAVN.Service.Campaign.MsSqlRepositories.csproj b/src/MAVN.Service.Campaign.MsSqlRepositories/MAVN.Service.Campaign.MsSqlRepositories.csproj index 7f2ed7e..c026ffa 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/MAVN.Service.Campaign.MsSqlRepositories.csproj +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/MAVN.Service.Campaign.MsSqlRepositories.csproj @@ -1,13 +1,17 @@ - netcoreapp2.2 + netcoreapp3.1 1.0.0 - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.Designer.cs deleted file mode 100644 index fdf1e49..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190605071509_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.cs deleted file mode 100644 index ec8a876..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190605071509_Initial.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "campaign"); - - migrationBuilder.CreateTable( - name: "bonus_type", - schema: "campaign", - columns: table => new - { - type = table.Column(type: "varchar(64)", nullable: false), - display_name = table.Column(nullable: true), - is_available = table.Column(nullable: false), - creation_date = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_bonus_type", x => x.type); - }); - - migrationBuilder.CreateTable( - name: "campaign", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - name = table.Column(nullable: true), - reward = table.Column(nullable: false), - from_date = table.Column(nullable: false), - to_date = table.Column(nullable: true), - description = table.Column(nullable: true), - completion_count = table.Column(nullable: false), - creation_date = table.Column(nullable: false), - created_by = table.Column(nullable: true), - is_deleted = table.Column(nullable: false), - is_enabled = table.Column(nullable: false), - reward_type = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_campaign", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "condition", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - bonus_type = table.Column(nullable: true), - immediate_reward = table.Column(nullable: false), - completion_count = table.Column(nullable: false), - campaign_id = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_condition", x => x.id); - table.ForeignKey( - name: "FK_condition_bonus_type_bonus_type", - column: x => x.bonus_type, - principalSchema: "campaign", - principalTable: "bonus_type", - principalColumn: "type", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_condition_campaign_campaign_id", - column: x => x.campaign_id, - principalSchema: "campaign", - principalTable: "campaign", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_condition_bonus_type", - schema: "campaign", - table: "condition", - column: "bonus_type"); - - migrationBuilder.CreateIndex( - name: "IX_condition_campaign_id", - schema: "campaign", - table: "condition", - column: "campaign_id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "condition", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "bonus_type", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "campaign", - schema: "campaign"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.Designer.cs deleted file mode 100644 index b3f62f3..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.Designer.cs +++ /dev/null @@ -1,144 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190628112730_AddConfiguration")] - partial class AddConfiguration - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.cs deleted file mode 100644 index 3e6369e..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190628112730_AddConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddConfiguration : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "configuration", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - LastProcessedDate = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_configuration", x => x.id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "configuration", - schema: "campaign"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.Designer.cs deleted file mode 100644 index 4f99d3f..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.Designer.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190702143552_AddRules")] - partial class AddRules - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("EarnRuleId") - .HasColumnName("earn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("EarnRuleId"); - - b.ToTable("earn_rule_content"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("earn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("SpendRuleId") - .HasColumnName("spend_rule_id"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("SpendRuleId"); - - b.ToTable("spend_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("spend_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", "EarnRule") - .WithMany("EarnRuleContents") - .HasForeignKey("EarnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleEntity", "SpendRule") - .WithMany("SpendRuleContents") - .HasForeignKey("SpendRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.cs deleted file mode 100644 index 4089696..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143552_AddRules.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddRules : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "earn_rules", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - title = table.Column(nullable: true), - description = table.Column(nullable: true), - creation_date = table.Column(nullable: false), - created_by = table.Column(nullable: true), - is_deleted = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_earn_rules", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "spend_rules", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - title = table.Column(nullable: true), - description = table.Column(nullable: true), - creation_date = table.Column(nullable: false), - created_by = table.Column(nullable: true), - is_deleted = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_spend_rules", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "earn_rule_content", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - earn_rule_id = table.Column(nullable: false), - content_type = table.Column(nullable: false), - localization = table.Column(nullable: false), - value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_earn_rule_content", x => x.id); - table.ForeignKey( - name: "FK_earn_rule_content_earn_rules_earn_rule_id", - column: x => x.earn_rule_id, - principalSchema: "campaign", - principalTable: "earn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "spend_rule_contents", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - spend_rule_id = table.Column(nullable: false), - content_type = table.Column(nullable: false), - localization = table.Column(nullable: false), - value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_spend_rule_contents", x => x.id); - table.ForeignKey( - name: "FK_spend_rule_contents_spend_rules_spend_rule_id", - column: x => x.spend_rule_id, - principalSchema: "campaign", - principalTable: "spend_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_earn_rule_content_earn_rule_id", - schema: "campaign", - table: "earn_rule_content", - column: "earn_rule_id"); - - migrationBuilder.CreateIndex( - name: "IX_spend_rule_contents_spend_rule_id", - schema: "campaign", - table: "spend_rule_contents", - column: "spend_rule_id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "earn_rule_content", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "spend_rule_contents", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "earn_rules", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "spend_rules", - schema: "campaign"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.Designer.cs deleted file mode 100644 index 89917bf..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.Designer.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190702143936_RenameEarnRuleContents")] - partial class RenameEarnRuleContents - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("EarnRuleId") - .HasColumnName("earn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("EarnRuleId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("earn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("SpendRuleId") - .HasColumnName("spend_rule_id"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("SpendRuleId"); - - b.ToTable("spend_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("spend_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", "EarnRule") - .WithMany("EarnRuleContents") - .HasForeignKey("EarnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleEntity", "SpendRule") - .WithMany("SpendRuleContents") - .HasForeignKey("SpendRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.cs deleted file mode 100644 index f12059b..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190702143936_RenameEarnRuleContents.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class RenameEarnRuleContents : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_earn_rule_content_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_content"); - - migrationBuilder.DropPrimaryKey( - name: "PK_earn_rule_content", - schema: "campaign", - table: "earn_rule_content"); - - migrationBuilder.RenameTable( - name: "earn_rule_content", - schema: "campaign", - newName: "earn_rule_contents", - newSchema: "campaign"); - - migrationBuilder.RenameIndex( - name: "IX_earn_rule_content_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents", - newName: "IX_earn_rule_contents_earn_rule_id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_earn_rule_contents", - schema: "campaign", - table: "earn_rule_contents", - column: "id"); - - migrationBuilder.AddForeignKey( - name: "FK_earn_rule_contents_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents", - column: "earn_rule_id", - principalSchema: "campaign", - principalTable: "earn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_earn_rule_contents_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents"); - - migrationBuilder.DropPrimaryKey( - name: "PK_earn_rule_contents", - schema: "campaign", - table: "earn_rule_contents"); - - migrationBuilder.RenameTable( - name: "earn_rule_contents", - schema: "campaign", - newName: "earn_rule_content", - newSchema: "campaign"); - - migrationBuilder.RenameIndex( - name: "IX_earn_rule_contents_earn_rule_id", - schema: "campaign", - table: "earn_rule_content", - newName: "IX_earn_rule_content_earn_rule_id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_earn_rule_content", - schema: "campaign", - table: "earn_rule_content", - column: "id"); - - migrationBuilder.AddForeignKey( - name: "FK_earn_rule_content_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_content", - column: "earn_rule_id", - principalSchema: "campaign", - principalTable: "earn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.Designer.cs deleted file mode 100644 index 13f0693..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.Designer.cs +++ /dev/null @@ -1,236 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190709063332_RemoveSpendRuleEntity")] - partial class RemoveSpendRuleEntity - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("EarnRuleId") - .HasColumnName("earn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("EarnRuleId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("earn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("spend_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleEntity", "EarnRule") - .WithMany("EarnRuleContents") - .HasForeignKey("EarnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.SpendRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("SpendRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.cs deleted file mode 100644 index 4d05097..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709063332_RemoveSpendRuleEntity.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class RemoveSpendRuleEntity : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_spend_rule_contents_spend_rules_spend_rule_id", - schema: "campaign", - table: "spend_rule_contents"); - - migrationBuilder.DropTable( - name: "spend_rules", - schema: "campaign"); - - migrationBuilder.RenameColumn( - name: "spend_rule_id", - schema: "campaign", - table: "spend_rule_contents", - newName: "campaign_id"); - - migrationBuilder.RenameIndex( - name: "IX_spend_rule_contents_spend_rule_id", - schema: "campaign", - table: "spend_rule_contents", - newName: "IX_spend_rule_contents_campaign_id"); - - migrationBuilder.AddForeignKey( - name: "FK_spend_rule_contents_campaign_campaign_id", - schema: "campaign", - table: "spend_rule_contents", - column: "campaign_id", - principalSchema: "campaign", - principalTable: "campaign", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_spend_rule_contents_campaign_campaign_id", - schema: "campaign", - table: "spend_rule_contents"); - - migrationBuilder.RenameColumn( - name: "campaign_id", - schema: "campaign", - table: "spend_rule_contents", - newName: "spend_rule_id"); - - migrationBuilder.RenameIndex( - name: "IX_spend_rule_contents_campaign_id", - schema: "campaign", - table: "spend_rule_contents", - newName: "IX_spend_rule_contents_spend_rule_id"); - - migrationBuilder.CreateTable( - name: "spend_rules", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - created_by = table.Column(nullable: true), - creation_date = table.Column(nullable: false), - description = table.Column(nullable: true), - is_deleted = table.Column(nullable: false), - title = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_spend_rules", x => x.id); - }); - - migrationBuilder.AddForeignKey( - name: "FK_spend_rule_contents_spend_rules_spend_rule_id", - schema: "campaign", - table: "spend_rule_contents", - column: "spend_rule_id", - principalSchema: "campaign", - principalTable: "spend_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.Designer.cs deleted file mode 100644 index 4cc7a30..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.Designer.cs +++ /dev/null @@ -1,236 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190709132731_RenameTables")] - partial class RenameTables - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.cs deleted file mode 100644 index b544976..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190709132731_RenameTables.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class RenameTables : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_earn_rule_contents_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents"); - - migrationBuilder.DropTable( - name: "earn_rules", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "spend_rule_contents", - schema: "campaign"); - - migrationBuilder.RenameColumn( - name: "earn_rule_id", - schema: "campaign", - table: "earn_rule_contents", - newName: "campaign_id"); - - migrationBuilder.RenameIndex( - name: "IX_earn_rule_contents_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents", - newName: "IX_earn_rule_contents_campaign_id"); - - migrationBuilder.CreateTable( - name: "burn_rules", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - title = table.Column(nullable: true), - description = table.Column(nullable: true), - creation_date = table.Column(nullable: false), - created_by = table.Column(nullable: true), - is_deleted = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_burn_rules", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "burn_rule_contents", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - burn_rule_id = table.Column(nullable: false), - content_type = table.Column(nullable: false), - localization = table.Column(nullable: false), - value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_burn_rule_contents", x => x.id); - table.ForeignKey( - name: "FK_burn_rule_contents_burn_rules_burn_rule_id", - column: x => x.burn_rule_id, - principalSchema: "campaign", - principalTable: "burn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_burn_rule_contents_burn_rule_id", - schema: "campaign", - table: "burn_rule_contents", - column: "burn_rule_id"); - - migrationBuilder.AddForeignKey( - name: "FK_earn_rule_contents_campaign_campaign_id", - schema: "campaign", - table: "earn_rule_contents", - column: "campaign_id", - principalSchema: "campaign", - principalTable: "campaign", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_earn_rule_contents_campaign_campaign_id", - schema: "campaign", - table: "earn_rule_contents"); - - migrationBuilder.DropTable( - name: "burn_rule_contents", - schema: "campaign"); - - migrationBuilder.DropTable( - name: "burn_rules", - schema: "campaign"); - - migrationBuilder.RenameColumn( - name: "campaign_id", - schema: "campaign", - table: "earn_rule_contents", - newName: "earn_rule_id"); - - migrationBuilder.RenameIndex( - name: "IX_earn_rule_contents_campaign_id", - schema: "campaign", - table: "earn_rule_contents", - newName: "IX_earn_rule_contents_earn_rule_id"); - - migrationBuilder.CreateTable( - name: "earn_rules", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - created_by = table.Column(nullable: true), - creation_date = table.Column(nullable: false), - description = table.Column(nullable: true), - is_deleted = table.Column(nullable: false), - title = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_earn_rules", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "spend_rule_contents", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - campaign_id = table.Column(nullable: false), - localization = table.Column(nullable: false), - content_type = table.Column(nullable: false), - value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_spend_rule_contents", x => x.id); - table.ForeignKey( - name: "FK_spend_rule_contents_campaign_campaign_id", - column: x => x.campaign_id, - principalSchema: "campaign", - principalTable: "campaign", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_spend_rule_contents_campaign_id", - schema: "campaign", - table: "spend_rule_contents", - column: "campaign_id"); - - migrationBuilder.AddForeignKey( - name: "FK_earn_rule_contents_earn_rules_earn_rule_id", - schema: "campaign", - table: "earn_rule_contents", - column: "earn_rule_id", - principalSchema: "campaign", - principalTable: "earn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.Designer.cs deleted file mode 100644 index 6a529fc..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.Designer.cs +++ /dev/null @@ -1,242 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190721212129_ConversionRate")] - partial class ConversionRate - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.cs deleted file mode 100644 index 274b505..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190721212129_ConversionRate.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class ConversionRate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules"); - - migrationBuilder.DropColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.Designer.cs deleted file mode 100644 index 6a4a5d2..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.Designer.cs +++ /dev/null @@ -1,251 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190820142424_BonusType_extended")] - partial class BonusType_extended - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.cs deleted file mode 100644 index 0f5b2dd..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190820142424_BonusType_extended.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class BonusType_extended : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "allow_infinite", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "allow_percentage", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "vertical", - schema: "campaign", - table: "bonus_type", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "allow_infinite", - schema: "campaign", - table: "bonus_type"); - - migrationBuilder.DropColumn( - name: "allow_percentage", - schema: "campaign", - table: "bonus_type"); - - migrationBuilder.DropColumn( - name: "vertical", - schema: "campaign", - table: "bonus_type"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.Designer.cs deleted file mode 100644 index 41319ba..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.Designer.cs +++ /dev/null @@ -1,278 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190822141404_AddConditionPartnerEntity")] - partial class AddConditionPartnerEntity - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.cs deleted file mode 100644 index 05fe4b3..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190822141404_AddConditionPartnerEntity.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddConditionPartnerEntity : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "condition_partners", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - condition_id = table.Column(nullable: false), - partner_id = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_condition_partners", x => x.id); - table.ForeignKey( - name: "FK_condition_partners_condition_condition_id", - column: x => x.condition_id, - principalSchema: "campaign", - principalTable: "condition", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_condition_partners_condition_id", - schema: "campaign", - table: "condition_partners", - column: "condition_id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "condition_partners", - schema: "campaign"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.Designer.cs deleted file mode 100644 index 0a86d22..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.Designer.cs +++ /dev/null @@ -1,308 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190903090554_AddPartnersAndVerticalToBurnRule")] - partial class AddPartnersAndVerticalToBurnRule - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.cs deleted file mode 100644 index 12e70bd..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190903090554_AddPartnersAndVerticalToBurnRule.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddPartnersAndVerticalToBurnRule : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "vertical", - schema: "campaign", - table: "burn_rules", - nullable: true); - - migrationBuilder.CreateTable( - name: "burn_rule_partners", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - burn_rule_id = table.Column(nullable: false), - partner_id = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_burn_rule_partners", x => x.id); - table.ForeignKey( - name: "FK_burn_rule_partners_burn_rules_burn_rule_id", - column: x => x.burn_rule_id, - principalSchema: "campaign", - principalTable: "burn_rules", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_burn_rule_partners_burn_rule_id", - schema: "campaign", - table: "burn_rule_partners", - column: "burn_rule_id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "burn_rule_partners", - schema: "campaign"); - - migrationBuilder.DropColumn( - name: "vertical", - schema: "campaign", - table: "burn_rules"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.Designer.cs deleted file mode 100644 index 7562caf..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.Designer.cs +++ /dev/null @@ -1,287 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190905101404_EarnRuleConversionRate")] - partial class EarnRuleConversionRate - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .HasColumnName("reward"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .HasColumnName("immediate_reward"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.cs deleted file mode 100644 index a5c65c4..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190905101404_EarnRuleConversionRate.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class EarnRuleConversionRate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "amount_in_currency", - schema: "campaign", - table: "campaign", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "campaign", - nullable: false, - defaultValue: 0L); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(int)); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(int)); - - migrationBuilder.AddColumn( - name: "allow_conversion_rate", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "amount_in_currency", - schema: "campaign", - table: "campaign"); - - migrationBuilder.DropColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "campaign"); - - migrationBuilder.DropColumn( - name: "allow_conversion_rate", - schema: "campaign", - table: "bonus_type"); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(long)); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(decimal)); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.Designer.cs deleted file mode 100644 index fcacafc..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.Designer.cs +++ /dev/null @@ -1,329 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20190924074638_Money18")] - partial class Money18 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.cs deleted file mode 100644 index 4391883..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20190924074638_Money18.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class Money18 : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "immediate_reward", - schema: "campaign", - table: "condition", - type: "nvarchar(64)", - nullable: false, - oldClrType: typeof(decimal)); - - migrationBuilder.AlterColumn( - name: "reward", - schema: "campaign", - table: "campaign", - type: "nvarchar(64)", - nullable: false, - oldClrType: typeof(decimal)); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "campaign", - type: "nvarchar(64)", - nullable: true, - oldClrType: typeof(long)); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "campaign", - nullable: true, - oldClrType: typeof(decimal)); - - migrationBuilder.AddColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "campaign", - nullable: false, - defaultValue: false); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules", - type: "nvarchar(64)", - nullable: true, - oldClrType: typeof(long)); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules", - nullable: true, - oldClrType: typeof(decimal)); - - migrationBuilder.AddColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "burn_rules", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "campaign"); - - migrationBuilder.DropColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "burn_rules"); - - migrationBuilder.AlterColumn( - name: "immediate_reward", - schema: "campaign", - table: "condition", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(64)"); - - migrationBuilder.AlterColumn( - name: "reward", - schema: "campaign", - table: "campaign", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(64)"); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "campaign", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(64)", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "campaign", - nullable: false, - oldClrType: typeof(decimal), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(64)", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "amount_in_currency", - schema: "campaign", - table: "burn_rules", - nullable: false, - oldClrType: typeof(decimal), - oldNullable: true); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.Designer.cs deleted file mode 100644 index 0c35337..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.Designer.cs +++ /dev/null @@ -1,347 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191015143609_AddStakingToConditions")] - partial class AddStakingToConditions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.cs deleted file mode 100644 index 08b68c9..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191015143609_AddStakingToConditions.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddStakingToConditions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "is_stakeable", - schema: "campaign", - table: "condition", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "stake_amount", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "stake_warning_period", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "staking_period", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "staking_rule", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "is_stakeable", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "is_stakeable", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "stake_amount", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "stake_warning_period", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "staking_period", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "staking_rule", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "is_stakeable", - schema: "campaign", - table: "bonus_type"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.Designer.cs deleted file mode 100644 index cef036a..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.Designer.cs +++ /dev/null @@ -1,347 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191016103143_RenameIsStackableInConditions")] - partial class RenameIsStackableInConditions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.cs deleted file mode 100644 index 32ebf4a..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191016103143_RenameIsStackableInConditions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class RenameIsStackableInConditions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "is_stakeable", - schema: "campaign", - table: "condition", - newName: "has_staking"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "has_staking", - schema: "campaign", - table: "condition", - newName: "is_stakeable"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.Designer.cs deleted file mode 100644 index 43a80d4..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.Designer.cs +++ /dev/null @@ -1,363 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191022112527_AddIsHiddenInBTAddConversionRateInConditions")] - partial class AddIsHiddenInBTAddConversionRateInConditions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.cs deleted file mode 100644 index e0e9523..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191022112527_AddIsHiddenInBTAddConversionRateInConditions.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddIsHiddenInBTAddConversionRateInConditions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "amount_in_currency", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "condition", - type: "nvarchar(64)", - nullable: true); - - migrationBuilder.AddColumn( - name: "reward_type", - schema: "campaign", - table: "condition", - nullable: true); - - migrationBuilder.AddColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "condition", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "is_hidden", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "amount_in_currency", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "amount_in_tokens", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "reward_type", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "use_partner_currency_rate", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "is_hidden", - schema: "campaign", - table: "bonus_type"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.Designer.cs deleted file mode 100644 index 54874fc..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.Designer.cs +++ /dev/null @@ -1,366 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191023053823_AddOrderToBonusTypes")] - partial class AddOrderToBonusTypes - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.cs deleted file mode 100644 index 64ec43b..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191023053823_AddOrderToBonusTypes.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddOrderToBonusTypes : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "order", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "order", - schema: "campaign", - table: "bonus_type"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.Designer.cs deleted file mode 100644 index 237da7f..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.Designer.cs +++ /dev/null @@ -1,369 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191029153447_AddBurningRuleInCondition")] - partial class AddBurningRuleInCondition - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("BurningRule") - .HasColumnName("burning_rule"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.cs deleted file mode 100644 index ac61547..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191029153447_AddBurningRuleInCondition.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddBurningRuleInCondition : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "burning_rule", - schema: "campaign", - table: "condition", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "burning_rule", - schema: "campaign", - table: "condition"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.Designer.cs deleted file mode 100644 index 3d335b6..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.Designer.cs +++ /dev/null @@ -1,402 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191106152812_AddConditionAttribute")] - partial class AddConditionAttribute - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("RewardHasRatio") - .HasColumnName("reward_has_ration"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionId") - .HasColumnName("condition_id"); - - b.Property("JsonValue") - .HasColumnName("json_value"); - - b.Property("Type") - .HasColumnName("type"); - - b.HasKey("Id"); - - b.HasIndex("ConditionId"); - - b.ToTable("condition_attribute"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("BurningRule") - .HasColumnName("burning_rule"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "Condition") - .WithMany("Attributes") - .HasForeignKey("ConditionId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.cs deleted file mode 100644 index e005152..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191106152812_AddConditionAttribute.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddConditionAttribute : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "reward_has_ration", - schema: "campaign", - table: "bonus_type", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateTable( - name: "condition_attribute", - schema: "campaign", - columns: table => new - { - id = table.Column(nullable: false), - condition_id = table.Column(nullable: false), - type = table.Column(nullable: false), - json_value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_condition_attribute", x => x.id); - table.ForeignKey( - name: "FK_condition_attribute_condition_condition_id", - column: x => x.condition_id, - principalSchema: "campaign", - principalTable: "condition", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_condition_attribute_condition_id", - schema: "campaign", - table: "condition_attribute", - column: "condition_id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "condition_attribute", - schema: "campaign"); - - migrationBuilder.DropColumn( - name: "reward_has_ration", - schema: "campaign", - table: "bonus_type"); - } - } -} diff --git "a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.cs" "b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.cs" deleted file mode 100644 index 3232bb2..0000000 --- "a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.cs" +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddApproximateАward : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "approximate_reward", - schema: "campaign", - table: "condition", - type: "nvarchar(64)", - nullable: true); - - migrationBuilder.AddColumn( - name: "approximate_reward", - schema: "campaign", - table: "campaign", - type: "nvarchar(64)", - nullable: true); - - migrationBuilder.Sql( - @"UPDATE campaign.campaign - SET approximate_reward = 0 - WHERE reward_type is not null - and reward_type = 'Percentage' or reward_type = 'ConversionRate' - and approximate_reward is null"); - - migrationBuilder.Sql( - @"UPDATE campaign.condition - SET approximate_reward = 0 - WHERE reward_type is not null - and reward_type = 1 or reward_type = 2 - and approximate_reward is null"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "approximate_reward", - schema: "campaign", - table: "condition"); - - migrationBuilder.DropColumn( - name: "approximate_reward", - schema: "campaign", - table: "campaign"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.Designer.cs deleted file mode 100644 index 6b1a5ee..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.Designer.cs +++ /dev/null @@ -1,375 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191203140741_AddOrderToCampaignAndBurnRules")] - partial class AddOrderToCampaignAndBurnRules - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("BurningRule") - .HasColumnName("burning_rule"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.cs deleted file mode 100644 index 5a1fe79..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191203140741_AddOrderToCampaignAndBurnRules.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class AddOrderToCampaignAndBurnRules : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "order", - schema: "campaign", - table: "campaign", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "order", - schema: "campaign", - table: "burn_rules", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "order", - schema: "campaign", - table: "campaign"); - - migrationBuilder.DropColumn( - name: "order", - schema: "campaign", - table: "burn_rules"); - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.Designer.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.Designer.cs deleted file mode 100644 index fca7d77..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.Designer.cs +++ /dev/null @@ -1,405 +0,0 @@ -// -using System; -using MAVN.Service.Campaign.MsSqlRepositories; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - [DbContext(typeof(CampaignContext))] - [Migration("20191204072300_SpendRulePrice")] - partial class SpendRulePrice - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => - { - b.Property("Type") - .ValueGeneratedOnAdd() - .HasColumnName("type") - .HasColumnType("varchar(64)"); - - b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); - - b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); - - b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("DisplayName") - .HasColumnName("display_name"); - - b.Property("IsAvailable") - .HasColumnName("is_available"); - - b.Property("IsHidden") - .HasColumnName("is_hidden"); - - b.Property("IsStakeable") - .HasColumnName("is_stakeable"); - - b.Property("Order") - .HasColumnName("order"); - - b.Property("RewardHasRatio") - .HasColumnName("reward_has_ration"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Type"); - - b.ToTable("bonus_type"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleId"); - - b.ToTable("burn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Price") - .HasColumnName("price"); - - b.Property("Title") - .HasColumnName("title"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.Property("Vertical") - .HasColumnName("vertical"); - - b.HasKey("Id"); - - b.ToTable("burn_rules"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("BurnRuleEntityId"); - - b.ToTable("burn_rule_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("CreatedBy") - .HasColumnName("created_by"); - - b.Property("CreationDate") - .HasColumnName("creation_date"); - - b.Property("Description") - .HasColumnName("description"); - - b.Property("FromDate") - .HasColumnName("from_date"); - - b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("IsEnabled") - .HasColumnName("is_enabled"); - - b.Property("Name") - .HasColumnName("name"); - - b.Property("Reward") - .IsRequired() - .HasColumnName("reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("ToDate") - .HasColumnName("to_date"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.ToTable("campaign"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionId") - .HasColumnName("condition_id"); - - b.Property("JsonValue") - .HasColumnName("json_value"); - - b.Property("Type") - .HasColumnName("type"); - - b.HasKey("Id"); - - b.HasIndex("ConditionId"); - - b.ToTable("condition_attribute"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); - - b.Property("AmountInTokens") - .HasColumnName("amount_in_tokens") - .HasColumnType("nvarchar(64)"); - - b.Property("BonusTypeName") - .HasColumnName("bonus_type"); - - b.Property("BurningRule") - .HasColumnName("burning_rule"); - - b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); - - b.Property("CompletionCount") - .HasColumnName("completion_count"); - - b.Property("HasStaking") - .HasColumnName("has_staking"); - - b.Property("ImmediateReward") - .IsRequired() - .HasColumnName("immediate_reward") - .HasColumnType("nvarchar(64)"); - - b.Property("RewardType") - .HasColumnName("reward_type"); - - b.Property("StakeAmount") - .HasColumnName("stake_amount"); - - b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); - - b.Property("StakingPeriod") - .HasColumnName("staking_period"); - - b.Property("StakingRule") - .HasColumnName("staking_rule"); - - b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); - - b.HasKey("Id"); - - b.HasIndex("BonusTypeName"); - - b.HasIndex("CampaignEntityId"); - - b.ToTable("condition"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("ConditionEntityId") - .HasColumnName("condition_id"); - - b.Property("PartnerId") - .HasColumnName("partner_id"); - - b.HasKey("Id"); - - b.HasIndex("ConditionEntityId"); - - b.ToTable("condition_partners"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.Configuration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("LastProcessedDate"); - - b.HasKey("Id"); - - b.ToTable("configuration"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnName("id"); - - b.Property("CampaignId") - .HasColumnName("campaign_id"); - - b.Property("Localization") - .HasColumnName("localization"); - - b.Property("RuleContentType") - .HasColumnName("content_type"); - - b.Property("Value") - .HasColumnName("value"); - - b.HasKey("Id"); - - b.HasIndex("CampaignId"); - - b.ToTable("earn_rule_contents"); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") - .WithMany("BurnRuleContents") - .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") - .WithMany("BurnRulePartners") - .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "Condition") - .WithMany("Attributes") - .HasForeignKey("ConditionId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", "BonusTypeEntity") - .WithMany("ConditionEntities") - .HasForeignKey("BonusTypeName"); - - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") - .WithMany("ConditionEntities") - .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") - .WithMany("ConditionPartners") - .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => - { - b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") - .WithMany("EarnRuleContents") - .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.cs deleted file mode 100644 index 1abaf69..0000000 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191204072300_SpendRulePrice.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations -{ - public partial class SpendRulePrice : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "price", - schema: "campaign", - table: "burn_rules", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "price", - schema: "campaign", - table: "burn_rules"); - } - } -} diff --git "a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.Designer.cs" b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.Designer.cs similarity index 57% rename from "src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.Designer.cs" rename to src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.Designer.cs index 749cd8b..4689fb4 100644 --- "a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20191202123500_AddApproximate\320\220ward.Designer.cs" +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.Designer.cs @@ -1,66 +1,76 @@ -// +// using System; using MAVN.Service.Campaign.MsSqlRepositories; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations { [DbContext(typeof(CampaignContext))] - [Migration("20191202123500_AddApproximateАward")] - partial class AddApproximateАward + [Migration("20200701122228_Initial")] + partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => { b.Property("Type") - .ValueGeneratedOnAdd() .HasColumnName("type") .HasColumnType("varchar(64)"); b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); + .HasColumnName("allow_conversion_rate") + .HasColumnType("boolean"); b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); + .HasColumnName("allow_infinite") + .HasColumnType("boolean"); b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); + .HasColumnName("allow_percentage") + .HasColumnType("boolean"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("DisplayName") - .HasColumnName("display_name"); + .HasColumnName("display_name") + .HasColumnType("text"); b.Property("IsAvailable") - .HasColumnName("is_available"); + .HasColumnName("is_available") + .HasColumnType("boolean"); b.Property("IsHidden") - .HasColumnName("is_hidden"); + .HasColumnName("is_hidden") + .HasColumnType("boolean"); b.Property("IsStakeable") - .HasColumnName("is_stakeable"); + .HasColumnName("is_stakeable") + .HasColumnType("boolean"); b.Property("Order") - .HasColumnName("order"); + .HasColumnName("order") + .HasColumnType("integer"); b.Property("RewardHasRatio") - .HasColumnName("reward_has_ration"); + .HasColumnName("reward_has_ration") + .HasColumnType("boolean"); b.Property("Vertical") - .HasColumnName("vertical"); + .HasColumnName("vertical") + .HasColumnType("text"); b.HasKey("Type"); @@ -71,19 +81,24 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); + .HasColumnName("burn_rule_id") + .HasColumnType("uuid"); b.Property("Localization") - .HasColumnName("localization"); + .HasColumnName("localization") + .HasColumnType("integer"); b.Property("RuleContentType") - .HasColumnName("content_type"); + .HasColumnName("content_type") + .HasColumnType("integer"); b.Property("Value") - .HasColumnName("value"); + .HasColumnName("value") + .HasColumnType("text"); b.HasKey("Id"); @@ -96,35 +111,52 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") .HasColumnType("nvarchar(64)"); b.Property("CreatedBy") - .HasColumnName("created_by"); + .HasColumnName("created_by") + .HasColumnType("text"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("Description") - .HasColumnName("description"); + .HasColumnName("description") + .HasColumnType("text"); b.Property("IsDeleted") - .HasColumnName("is_deleted"); + .HasColumnName("is_deleted") + .HasColumnType("boolean"); + + b.Property("Order") + .HasColumnName("order") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnName("price") + .HasColumnType("numeric"); b.Property("Title") - .HasColumnName("title"); + .HasColumnName("title") + .HasColumnType("text"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.Property("Vertical") - .HasColumnName("vertical"); + .HasColumnName("vertical") + .HasColumnType("text"); b.HasKey("Id"); @@ -135,13 +167,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); + .HasColumnName("burn_rule_id") + .HasColumnType("uuid"); b.Property("PartnerId") - .HasColumnName("partner_id"); + .HasColumnName("partner_id") + .HasColumnType("uuid"); b.HasKey("Id"); @@ -154,10 +189,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") @@ -168,28 +205,40 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("CompletionCount") - .HasColumnName("completion_count"); + .HasColumnName("completion_count") + .HasColumnType("integer"); b.Property("CreatedBy") - .HasColumnName("created_by"); + .HasColumnName("created_by") + .HasColumnType("text"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("Description") - .HasColumnName("description"); + .HasColumnName("description") + .HasColumnType("text"); b.Property("FromDate") - .HasColumnName("from_date"); + .HasColumnName("from_date") + .HasColumnType("timestamp without time zone"); b.Property("IsDeleted") - .HasColumnName("is_deleted"); + .HasColumnName("is_deleted") + .HasColumnType("boolean"); b.Property("IsEnabled") - .HasColumnName("is_enabled"); + .HasColumnName("is_enabled") + .HasColumnType("boolean"); b.Property("Name") - .HasColumnName("name"); + .HasColumnName("name") + .HasColumnType("text"); + + b.Property("Order") + .HasColumnName("order") + .HasColumnType("integer"); b.Property("Reward") .IsRequired() @@ -197,13 +246,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("RewardType") - .HasColumnName("reward_type"); + .HasColumnName("reward_type") + .HasColumnType("text"); b.Property("ToDate") - .HasColumnName("to_date"); + .HasColumnName("to_date") + .HasColumnType("timestamp without time zone"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.HasKey("Id"); @@ -214,16 +266,20 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("ConditionId") - .HasColumnName("condition_id"); + .HasColumnName("condition_id") + .HasColumnType("uuid"); b.Property("JsonValue") - .HasColumnName("json_value"); + .HasColumnName("json_value") + .HasColumnType("text"); b.Property("Type") - .HasColumnName("type"); + .HasColumnName("type") + .HasColumnType("integer"); b.HasKey("Id"); @@ -236,10 +292,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") @@ -250,19 +308,24 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("BonusTypeName") - .HasColumnName("bonus_type"); + .HasColumnName("bonus_type") + .HasColumnType("varchar(64)"); b.Property("BurningRule") - .HasColumnName("burning_rule"); + .HasColumnName("burning_rule") + .HasColumnType("numeric"); b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); + .HasColumnName("campaign_id") + .HasColumnType("uuid"); b.Property("CompletionCount") - .HasColumnName("completion_count"); + .HasColumnName("completion_count") + .HasColumnType("integer"); b.Property("HasStaking") - .HasColumnName("has_staking"); + .HasColumnName("has_staking") + .HasColumnType("boolean"); b.Property("ImmediateReward") .IsRequired() @@ -270,22 +333,28 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("RewardType") - .HasColumnName("reward_type"); + .HasColumnName("reward_type") + .HasColumnType("integer"); b.Property("StakeAmount") - .HasColumnName("stake_amount"); + .HasColumnName("stake_amount") + .HasColumnType("text"); b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); + .HasColumnName("stake_warning_period") + .HasColumnType("integer"); b.Property("StakingPeriod") - .HasColumnName("staking_period"); + .HasColumnName("staking_period") + .HasColumnType("integer"); b.Property("StakingRule") - .HasColumnName("staking_rule"); + .HasColumnName("staking_rule") + .HasColumnType("numeric"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.HasKey("Id"); @@ -300,13 +369,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("ConditionEntityId") - .HasColumnName("condition_id"); + .HasColumnName("condition_id") + .HasColumnType("uuid"); b.Property("PartnerId") - .HasColumnName("partner_id"); + .HasColumnName("partner_id") + .HasColumnType("uuid"); b.HasKey("Id"); @@ -319,9 +391,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); - b.Property("LastProcessedDate"); + b.Property("LastProcessedDate") + .HasColumnType("timestamp without time zone"); b.HasKey("Id"); @@ -332,19 +406,24 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("CampaignId") - .HasColumnName("campaign_id"); + .HasColumnName("campaign_id") + .HasColumnType("uuid"); b.Property("Localization") - .HasColumnName("localization"); + .HasColumnName("localization") + .HasColumnType("integer"); b.Property("RuleContentType") - .HasColumnName("content_type"); + .HasColumnName("content_type") + .HasColumnType("integer"); b.Property("Value") - .HasColumnName("value"); + .HasColumnName("value") + .HasColumnType("text"); b.HasKey("Id"); @@ -358,7 +437,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") .WithMany("BurnRuleContents") .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => @@ -366,7 +446,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") .WithMany("BurnRulePartners") .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => @@ -374,7 +455,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "Condition") .WithMany("Attributes") .HasForeignKey("ConditionId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => @@ -386,7 +468,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") .WithMany("ConditionEntities") .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => @@ -394,7 +477,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") .WithMany("ConditionPartners") .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => @@ -402,7 +486,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") .WithMany("EarnRuleContents") .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); #pragma warning restore 612, 618 } diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.cs new file mode 100644 index 0000000..9603539 --- /dev/null +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/20200701122228_Initial.cs @@ -0,0 +1,337 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.EnsureSchema( + name: "campaign"); + + migrationBuilder.CreateTable( + name: "bonus_type", + schema: "campaign", + columns: table => new + { + type = table.Column(nullable: false), + display_name = table.Column(nullable: true), + is_available = table.Column(nullable: false), + vertical = table.Column(nullable: true), + allow_infinite = table.Column(nullable: false), + allow_percentage = table.Column(nullable: false), + is_stakeable = table.Column(nullable: false), + allow_conversion_rate = table.Column(nullable: false), + creation_date = table.Column(nullable: false), + is_hidden = table.Column(nullable: false), + order = table.Column(nullable: false), + reward_has_ration = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_bonus_type", x => x.type); + }); + + migrationBuilder.CreateTable( + name: "burn_rules", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + title = table.Column(nullable: true), + description = table.Column(nullable: true), + amount_in_tokens = table.Column( nullable: true), + amount_in_currency = table.Column(nullable: true), + use_partner_currency_rate = table.Column(nullable: false), + vertical = table.Column(nullable: true), + price = table.Column(nullable: true), + creation_date = table.Column(nullable: false), + created_by = table.Column(nullable: true), + is_deleted = table.Column(nullable: false), + order = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_burn_rules", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "campaign", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + name = table.Column(nullable: true), + description = table.Column(nullable: true), + reward = table.Column(nullable: false), + approximate_reward = table.Column(nullable: true), + reward_type = table.Column(nullable: true), + amount_in_tokens = table.Column( nullable: true), + amount_in_currency = table.Column(nullable: true), + use_partner_currency_rate = table.Column(nullable: false), + from_date = table.Column(nullable: false), + to_date = table.Column(nullable: true), + completion_count = table.Column(nullable: false), + is_deleted = table.Column(nullable: false), + is_enabled = table.Column(nullable: false), + creation_date = table.Column(nullable: false), + created_by = table.Column(nullable: true), + order = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_campaign", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "configuration", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + LastProcessedDate = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_configuration", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "burn_rule_contents", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + burn_rule_id = table.Column(nullable: false), + content_type = table.Column(nullable: false), + localization = table.Column(nullable: false), + value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_burn_rule_contents", x => x.id); + table.ForeignKey( + name: "FK_burn_rule_contents_burn_rules_burn_rule_id", + column: x => x.burn_rule_id, + principalSchema: "campaign", + principalTable: "burn_rules", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "burn_rule_partners", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + burn_rule_id = table.Column(nullable: false), + partner_id = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_burn_rule_partners", x => x.id); + table.ForeignKey( + name: "FK_burn_rule_partners_burn_rules_burn_rule_id", + column: x => x.burn_rule_id, + principalSchema: "campaign", + principalTable: "burn_rules", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "condition", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + bonus_type = table.Column(nullable: true), + immediate_reward = table.Column( nullable: false), + approximate_reward = table.Column(nullable: true), + completion_count = table.Column(nullable: false), + campaign_id = table.Column(nullable: false), + has_staking = table.Column(nullable: false), + stake_amount = table.Column(nullable: true), + staking_period = table.Column(nullable: true), + stake_warning_period = table.Column(nullable: true), + staking_rule = table.Column(nullable: true), + burning_rule = table.Column(nullable: true), + amount_in_tokens = table.Column(nullable: true), + amount_in_currency = table.Column(nullable: true), + use_partner_currency_rate = table.Column(nullable: false), + reward_type = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_condition", x => x.id); + table.ForeignKey( + name: "FK_condition_bonus_type_bonus_type", + column: x => x.bonus_type, + principalSchema: "campaign", + principalTable: "bonus_type", + principalColumn: "type", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_condition_campaign_campaign_id", + column: x => x.campaign_id, + principalSchema: "campaign", + principalTable: "campaign", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "earn_rule_contents", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + campaign_id = table.Column(nullable: false), + content_type = table.Column(nullable: false), + localization = table.Column(nullable: false), + value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_earn_rule_contents", x => x.id); + table.ForeignKey( + name: "FK_earn_rule_contents_campaign_campaign_id", + column: x => x.campaign_id, + principalSchema: "campaign", + principalTable: "campaign", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "condition_attribute", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + condition_id = table.Column(nullable: false), + type = table.Column(nullable: false), + json_value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_condition_attribute", x => x.id); + table.ForeignKey( + name: "FK_condition_attribute_condition_condition_id", + column: x => x.condition_id, + principalSchema: "campaign", + principalTable: "condition", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "condition_partners", + schema: "campaign", + columns: table => new + { + id = table.Column(nullable: false), + condition_id = table.Column(nullable: false), + partner_id = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_condition_partners", x => x.id); + table.ForeignKey( + name: "FK_condition_partners_condition_condition_id", + column: x => x.condition_id, + principalSchema: "campaign", + principalTable: "condition", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_burn_rule_contents_burn_rule_id", + schema: "campaign", + table: "burn_rule_contents", + column: "burn_rule_id"); + + migrationBuilder.CreateIndex( + name: "IX_burn_rule_partners_burn_rule_id", + schema: "campaign", + table: "burn_rule_partners", + column: "burn_rule_id"); + + migrationBuilder.CreateIndex( + name: "IX_condition_bonus_type", + schema: "campaign", + table: "condition", + column: "bonus_type"); + + migrationBuilder.CreateIndex( + name: "IX_condition_campaign_id", + schema: "campaign", + table: "condition", + column: "campaign_id"); + + migrationBuilder.CreateIndex( + name: "IX_condition_attribute_condition_id", + schema: "campaign", + table: "condition_attribute", + column: "condition_id"); + + migrationBuilder.CreateIndex( + name: "IX_condition_partners_condition_id", + schema: "campaign", + table: "condition_partners", + column: "condition_id"); + + migrationBuilder.CreateIndex( + name: "IX_earn_rule_contents_campaign_id", + schema: "campaign", + table: "earn_rule_contents", + column: "campaign_id"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "burn_rule_contents", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "burn_rule_partners", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "condition_attribute", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "condition_partners", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "configuration", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "earn_rule_contents", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "burn_rules", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "condition", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "bonus_type", + schema: "campaign"); + + migrationBuilder.DropTable( + name: "campaign", + schema: "campaign"); + } + } +} diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/CampaignContextModelSnapshot.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/CampaignContextModelSnapshot.cs index f9c30c3..7cf9409 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/CampaignContextModelSnapshot.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Migrations/CampaignContextModelSnapshot.cs @@ -1,10 +1,10 @@ -// +// using System; using MAVN.Service.Campaign.MsSqlRepositories; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace MAVN.Service.Campaign.MsSqlRepositories.Migrations { @@ -16,49 +16,59 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("campaign") - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BonusTypeEntity", b => { b.Property("Type") - .ValueGeneratedOnAdd() .HasColumnName("type") .HasColumnType("varchar(64)"); b.Property("AllowConversionRate") - .HasColumnName("allow_conversion_rate"); + .HasColumnName("allow_conversion_rate") + .HasColumnType("boolean"); b.Property("AllowInfinite") - .HasColumnName("allow_infinite"); + .HasColumnName("allow_infinite") + .HasColumnType("boolean"); b.Property("AllowPercentage") - .HasColumnName("allow_percentage"); + .HasColumnName("allow_percentage") + .HasColumnType("boolean"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("DisplayName") - .HasColumnName("display_name"); + .HasColumnName("display_name") + .HasColumnType("text"); b.Property("IsAvailable") - .HasColumnName("is_available"); + .HasColumnName("is_available") + .HasColumnType("boolean"); b.Property("IsHidden") - .HasColumnName("is_hidden"); + .HasColumnName("is_hidden") + .HasColumnType("boolean"); b.Property("IsStakeable") - .HasColumnName("is_stakeable"); + .HasColumnName("is_stakeable") + .HasColumnType("boolean"); b.Property("Order") - .HasColumnName("order"); + .HasColumnName("order") + .HasColumnType("integer"); b.Property("RewardHasRatio") - .HasColumnName("reward_has_ration"); + .HasColumnName("reward_has_ration") + .HasColumnType("boolean"); b.Property("Vertical") - .HasColumnName("vertical"); + .HasColumnName("vertical") + .HasColumnType("text"); b.HasKey("Type"); @@ -69,19 +79,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("BurnRuleId") - .HasColumnName("burn_rule_id"); + .HasColumnName("burn_rule_id") + .HasColumnType("uuid"); b.Property("Localization") - .HasColumnName("localization"); + .HasColumnName("localization") + .HasColumnType("integer"); b.Property("RuleContentType") - .HasColumnName("content_type"); + .HasColumnName("content_type") + .HasColumnType("integer"); b.Property("Value") - .HasColumnName("value"); + .HasColumnName("value") + .HasColumnType("text"); b.HasKey("Id"); @@ -94,41 +109,52 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") .HasColumnType("nvarchar(64)"); b.Property("CreatedBy") - .HasColumnName("created_by"); + .HasColumnName("created_by") + .HasColumnType("text"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("Description") - .HasColumnName("description"); + .HasColumnName("description") + .HasColumnType("text"); b.Property("IsDeleted") - .HasColumnName("is_deleted"); - - b.Property("Price") - .HasColumnName("price"); + .HasColumnName("is_deleted") + .HasColumnType("boolean"); b.Property("Order") - .HasColumnName("order"); + .HasColumnName("order") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnName("price") + .HasColumnType("numeric"); b.Property("Title") - .HasColumnName("title"); + .HasColumnName("title") + .HasColumnType("text"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.Property("Vertical") - .HasColumnName("vertical"); + .HasColumnName("vertical") + .HasColumnType("text"); b.HasKey("Id"); @@ -139,13 +165,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("BurnRuleEntityId") - .HasColumnName("burn_rule_id"); + .HasColumnName("burn_rule_id") + .HasColumnType("uuid"); b.Property("PartnerId") - .HasColumnName("partner_id"); + .HasColumnName("partner_id") + .HasColumnType("uuid"); b.HasKey("Id"); @@ -158,10 +187,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") @@ -172,31 +203,40 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("CompletionCount") - .HasColumnName("completion_count"); + .HasColumnName("completion_count") + .HasColumnType("integer"); b.Property("CreatedBy") - .HasColumnName("created_by"); + .HasColumnName("created_by") + .HasColumnType("text"); b.Property("CreationDate") - .HasColumnName("creation_date"); + .HasColumnName("creation_date") + .HasColumnType("timestamp without time zone"); b.Property("Description") - .HasColumnName("description"); + .HasColumnName("description") + .HasColumnType("text"); b.Property("FromDate") - .HasColumnName("from_date"); + .HasColumnName("from_date") + .HasColumnType("timestamp without time zone"); b.Property("IsDeleted") - .HasColumnName("is_deleted"); + .HasColumnName("is_deleted") + .HasColumnType("boolean"); b.Property("IsEnabled") - .HasColumnName("is_enabled"); + .HasColumnName("is_enabled") + .HasColumnType("boolean"); b.Property("Name") - .HasColumnName("name"); + .HasColumnName("name") + .HasColumnType("text"); b.Property("Order") - .HasColumnName("order"); + .HasColumnName("order") + .HasColumnType("integer"); b.Property("Reward") .IsRequired() @@ -204,13 +244,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("RewardType") - .HasColumnName("reward_type"); + .HasColumnName("reward_type") + .HasColumnType("text"); b.Property("ToDate") - .HasColumnName("to_date"); + .HasColumnName("to_date") + .HasColumnType("timestamp without time zone"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.HasKey("Id"); @@ -221,16 +264,20 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("ConditionId") - .HasColumnName("condition_id"); + .HasColumnName("condition_id") + .HasColumnType("uuid"); b.Property("JsonValue") - .HasColumnName("json_value"); + .HasColumnName("json_value") + .HasColumnType("text"); b.Property("Type") - .HasColumnName("type"); + .HasColumnName("type") + .HasColumnType("integer"); b.HasKey("Id"); @@ -243,10 +290,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("AmountInCurrency") - .HasColumnName("amount_in_currency"); + .HasColumnName("amount_in_currency") + .HasColumnType("numeric"); b.Property("AmountInTokens") .HasColumnName("amount_in_tokens") @@ -257,19 +306,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("BonusTypeName") - .HasColumnName("bonus_type"); + .HasColumnName("bonus_type") + .HasColumnType("varchar(64)"); b.Property("BurningRule") - .HasColumnName("burning_rule"); + .HasColumnName("burning_rule") + .HasColumnType("numeric"); b.Property("CampaignEntityId") - .HasColumnName("campaign_id"); + .HasColumnName("campaign_id") + .HasColumnType("uuid"); b.Property("CompletionCount") - .HasColumnName("completion_count"); + .HasColumnName("completion_count") + .HasColumnType("integer"); b.Property("HasStaking") - .HasColumnName("has_staking"); + .HasColumnName("has_staking") + .HasColumnType("boolean"); b.Property("ImmediateReward") .IsRequired() @@ -277,22 +331,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(64)"); b.Property("RewardType") - .HasColumnName("reward_type"); + .HasColumnName("reward_type") + .HasColumnType("integer"); b.Property("StakeAmount") - .HasColumnName("stake_amount"); + .HasColumnName("stake_amount") + .HasColumnType("text"); b.Property("StakeWarningPeriod") - .HasColumnName("stake_warning_period"); + .HasColumnName("stake_warning_period") + .HasColumnType("integer"); b.Property("StakingPeriod") - .HasColumnName("staking_period"); + .HasColumnName("staking_period") + .HasColumnType("integer"); b.Property("StakingRule") - .HasColumnName("staking_rule"); + .HasColumnName("staking_rule") + .HasColumnType("numeric"); b.Property("UsePartnerCurrencyRate") - .HasColumnName("use_partner_currency_rate"); + .HasColumnName("use_partner_currency_rate") + .HasColumnType("boolean"); b.HasKey("Id"); @@ -307,13 +367,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("ConditionEntityId") - .HasColumnName("condition_id"); + .HasColumnName("condition_id") + .HasColumnType("uuid"); b.Property("PartnerId") - .HasColumnName("partner_id"); + .HasColumnName("partner_id") + .HasColumnType("uuid"); b.HasKey("Id"); @@ -326,9 +389,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); - b.Property("LastProcessedDate"); + b.Property("LastProcessedDate") + .HasColumnType("timestamp without time zone"); b.HasKey("Id"); @@ -339,19 +404,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnName("id"); + .HasColumnName("id") + .HasColumnType("uuid"); b.Property("CampaignId") - .HasColumnName("campaign_id"); + .HasColumnName("campaign_id") + .HasColumnType("uuid"); b.Property("Localization") - .HasColumnName("localization"); + .HasColumnName("localization") + .HasColumnType("integer"); b.Property("RuleContentType") - .HasColumnName("content_type"); + .HasColumnName("content_type") + .HasColumnType("integer"); b.Property("Value") - .HasColumnName("value"); + .HasColumnName("value") + .HasColumnType("text"); b.HasKey("Id"); @@ -365,7 +435,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRule") .WithMany("BurnRuleContents") .HasForeignKey("BurnRuleId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRulePartnerEntity", b => @@ -373,7 +444,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.BurnRuleEntity", "BurnRuleEntity") .WithMany("BurnRulePartners") .HasForeignKey("BurnRuleEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionAttributeEntity", b => @@ -381,7 +453,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "Condition") .WithMany("Attributes") .HasForeignKey("ConditionId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", b => @@ -393,7 +466,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "CampaignEntity") .WithMany("ConditionEntities") .HasForeignKey("CampaignEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionPartnerEntity", b => @@ -401,7 +475,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.ConditionEntity", "ConditionEntity") .WithMany("ConditionPartners") .HasForeignKey("ConditionEntityId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("MAVN.Service.Campaign.MsSqlRepositories.Entities.EarnRuleContentEntity", b => @@ -409,7 +484,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("MAVN.Service.Campaign.MsSqlRepositories.Entities.CampaignEntity", "Campaign") .WithMany("EarnRuleContents") .HasForeignKey("CampaignId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); #pragma warning restore 612, 618 } diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BonusTypeRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BonusTypeRepository.cs index 5ba64be..d54cd25 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BonusTypeRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BonusTypeRepository.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using AutoMapper; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Models; using MAVN.Service.Campaign.Domain.Repositories; using MAVN.Service.Campaign.MsSqlRepositories.Entities; @@ -12,11 +12,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class BonusTypeRepository : IBonusTypeRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public BonusTypeRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory; diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleContentRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleContentRepository.cs index 546e378..0b4e631 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleContentRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleContentRepository.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using AutoMapper; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Enums; using MAVN.Service.Campaign.Domain.Models.BurnRules; using MAVN.Service.Campaign.Domain.Repositories; @@ -13,11 +13,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class BurnRuleContentRepository : IBurnRuleContentRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public BurnRuleContentRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory ?? diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRulePartnerRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRulePartnerRepository.cs index 9fdef96..fae93e8 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRulePartnerRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRulePartnerRepository.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Repositories; using MAVN.Service.Campaign.MsSqlRepositories.Entities; @@ -10,9 +10,9 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class BurnRulePartnerRepository : IBurnRulePartnerRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; - public BurnRulePartnerRepository(MsSqlContextFactory msSqlContextFactory) + public BurnRulePartnerRepository(PostgreSQLContextFactory msSqlContextFactory) { _msSqlContextFactory = msSqlContextFactory ?? throw new ArgumentNullException(nameof(msSqlContextFactory)); diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleRepository.cs index 9293f4c..d2f3154 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/BurnRuleRepository.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using AutoMapper; using LinqKit; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Models.BurnRules; using MAVN.Service.Campaign.Domain.Repositories; using MAVN.Service.Campaign.MsSqlRepositories.Entities; @@ -15,11 +15,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class BurnRuleRepository : IBurnRuleRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public BurnRuleRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory ?? diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/CampaignRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/CampaignRepository.cs index e78c1b4..7218c86 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/CampaignRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/CampaignRepository.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using AutoMapper; using LinqKit; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Enums; using MAVN.Service.Campaign.Domain.Models; using MAVN.Service.Campaign.Domain.Repositories; @@ -17,11 +17,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class CampaignRepository : ICampaignRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public CampaignRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory; diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConditionRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConditionRepository.cs index 15bc95a..6baf47a 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConditionRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConditionRepository.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using AutoMapper; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Models; using MAVN.Service.Campaign.Domain.Repositories; using MAVN.Service.Campaign.MsSqlRepositories.Entities; @@ -14,11 +14,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class ConditionRepository : IConditionRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public ConditionRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory; diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConfigurationRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConfigurationRepository.cs index d1e6a7e..873ce99 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConfigurationRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/ConfigurationRepository.cs @@ -1,6 +1,6 @@ -using System; +using System; using System.Threading.Tasks; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Repositories; using Microsoft.EntityFrameworkCore; @@ -8,9 +8,9 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class ConfigurationRepository : IConfigurationRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; - public ConfigurationRepository(MsSqlContextFactory msSqlContextFactory) + public ConfigurationRepository(PostgreSQLContextFactory msSqlContextFactory) { _msSqlContextFactory = msSqlContextFactory ?? throw new ArgumentNullException(nameof(msSqlContextFactory)); diff --git a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/EarnRuleContentRepository.cs b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/EarnRuleContentRepository.cs index b302076..b23eec1 100644 --- a/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/EarnRuleContentRepository.cs +++ b/src/MAVN.Service.Campaign.MsSqlRepositories/Repositories/EarnRuleContentRepository.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using AutoMapper; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Enums; using MAVN.Service.Campaign.Domain.Models.EarnRules; using MAVN.Service.Campaign.Domain.Repositories; @@ -13,11 +13,11 @@ namespace MAVN.Service.Campaign.MsSqlRepositories.Repositories { public class EarnRuleContentRepository : IEarnRuleContentRepository { - private readonly MsSqlContextFactory _msSqlContextFactory; + private readonly PostgreSQLContextFactory _msSqlContextFactory; private readonly IMapper _mapper; public EarnRuleContentRepository( - MsSqlContextFactory msSqlContextFactory, + PostgreSQLContextFactory msSqlContextFactory, IMapper mapper) { _msSqlContextFactory = msSqlContextFactory ?? diff --git a/src/MAVN.Service.Campaign/Dockerfile b/src/MAVN.Service.Campaign/Dockerfile index 5dab6c9..ccdc3f4 100644 --- a/src/MAVN.Service.Campaign/Dockerfile +++ b/src/MAVN.Service.Campaign/Dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/dotnet:2.2-aspnetcore-runtime +FROM microsoft/dotnet:3.1-aspnetcore-runtime WORKDIR /app COPY . . ENTRYPOINT ["dotnet", "MAVN.Service.Campaign.dll"] diff --git a/src/MAVN.Service.Campaign/MAVN.Service.Campaign.csproj b/src/MAVN.Service.Campaign/MAVN.Service.Campaign.csproj index 8c9b229..3631230 100644 --- a/src/MAVN.Service.Campaign/MAVN.Service.Campaign.csproj +++ b/src/MAVN.Service.Campaign/MAVN.Service.Campaign.csproj @@ -1,6 +1,6 @@ - netcoreapp2.2 + netcoreapp3.1 Exe 1.0.0 @@ -13,13 +13,17 @@ latest + + Always + PreserveNewest - + + diff --git a/tests/MAVN.Service.Campaign.MsSqlRepositories.Tests/MAVN.Service.Campaign.MsSqlRepositories.Tests.csproj b/tests/MAVN.Service.Campaign.MsSqlRepositories.Tests/MAVN.Service.Campaign.MsSqlRepositories.Tests.csproj index 17e3e0e..7d598bd 100644 --- a/tests/MAVN.Service.Campaign.MsSqlRepositories.Tests/MAVN.Service.Campaign.MsSqlRepositories.Tests.csproj +++ b/tests/MAVN.Service.Campaign.MsSqlRepositories.Tests/MAVN.Service.Campaign.MsSqlRepositories.Tests.csproj @@ -1,14 +1,17 @@ - netcoreapp2.2 + netcoreapp3.1 false 1.0.0 - - + + - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/tests/MAVN.Service.Campaign.Tests/MAVN.Service.Campaign.Tests.csproj b/tests/MAVN.Service.Campaign.Tests/MAVN.Service.Campaign.Tests.csproj index c220e03..44d54b4 100644 --- a/tests/MAVN.Service.Campaign.Tests/MAVN.Service.Campaign.Tests.csproj +++ b/tests/MAVN.Service.Campaign.Tests/MAVN.Service.Campaign.Tests.csproj @@ -1,21 +1,21 @@ - netcoreapp2.2 + netcoreapp3.1 1.0.0 latest - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - + + + + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MAVN.Service.Campaign.Tests/MsSqlRepositories/CampaignRepositoryTest.cs b/tests/MAVN.Service.Campaign.Tests/MsSqlRepositories/CampaignRepositoryTest.cs index 05cb3b6..b610060 100644 --- a/tests/MAVN.Service.Campaign.Tests/MsSqlRepositories/CampaignRepositoryTest.cs +++ b/tests/MAVN.Service.Campaign.Tests/MsSqlRepositories/CampaignRepositoryTest.cs @@ -1,6 +1,6 @@ -using System.Linq; +using System.Linq; using System.Threading.Tasks; -using MAVN.Common.MsSql; +using MAVN.Persistence.PostgreSQL.Legacy; using MAVN.Service.Campaign.Domain.Models; using MAVN.Service.Campaign.MsSqlRepositories; using MAVN.Service.Campaign.MsSqlRepositories.Repositories; @@ -21,7 +21,7 @@ public CampaignRepositoryTest() var bonusEngineContext = contextFixture.BonusEngineContext; - var postgresContextFactory = new MsSqlContextFactory( + var postgresContextFactory = new PostgreSQLContextFactory( dbCtx => bonusEngineContext, contextFixture.DbContextOptions); _campaignRepository = new CampaignRepository(postgresContextFactory, mapper);