Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public override void Up()
// Adding in Invoice limits

// Enterprise Plus Plan Invoice Limits
Insert.IntoTable("PlanLimits".ToLower()).Row(new { PlanId = 1, LimitType = 5, LimitValue = 100000 });
Insert.IntoTable("PlanLimits".ToLower()).Row(new { planlimitid = 5, planid = 1, limittype = 5, limitvalue = 100000 });

// Finish Adding in Invoice limits

Expand All @@ -27,7 +27,7 @@ public override void Up()
.ToTable("Plans".ToLower()).PrimaryColumn("PlanId".ToLower());

// Standard Plan PTT Addon
Insert.IntoTable("PlanAddons".ToLower()).Row(new { PlanAddonId = "456ed5d4-57e1-4882-b433-1d3cc239103d", PlanId = 1, AddonType = 1, Cost = 0, ExternalId = "" });
Insert.IntoTable("PlanAddons".ToLower()).Row(new { planaddonid = "456ed5d4-57e1-4882-b433-1d3cc239103d", planid = 1, addontype = 1, cost = 0, externalid = "" });

Create.Table("PaymentAddons".ToLower())
.WithColumn("PaymentAddonId".ToLower()).AsCustom("citext").NotNullable().PrimaryKey()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public override void Up()

Alter.Table("PlanAddons".ToLower()).AlterColumn("PlanId".ToLower()).AsInt32().Nullable();
Alter.Table("PlanAddons".ToLower()).AddColumn("TestExternalId".ToLower()).AsCustom("citext").Nullable();
Insert.IntoTable("PlanAddons".ToLower()).Row(new { PlanAddonId = "6f4c5f8b-584d-4291-8a7d-29bf97ae6aa9", AddonType = 1, Cost = 35, ExternalId = "price_0N7MM5qJFDZJcnkVZy4Z51IC", TestExternalId = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
Insert.IntoTable("PlanAddons".ToLower()).Row(new { planaddonid = "6f4c5f8b-584d-4291-8a7d-29bf97ae6aa9", addontype = 1, cost = 35, externalid = "price_0N7MM5qJFDZJcnkVZy4Z51IC", testexternalid = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
}

public override void Down()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public override void Up()
Alter.Table("Plans".ToLower()).AddColumn("TestExternalId".ToLower()).AsCustom("citext").Nullable();
Alter.Table("Payments".ToLower()).AddColumn("Quantity".ToLower()).AsInt64().NotNullable().WithDefaultValue(1);

Insert.IntoTable("Plans".ToLower()).Row(new { PlanId = 36, Name = "Entity", Cost = 0, Frequency = 3, ExternalId = "price_0OLxxPqJFDZJcnkVDRHyMUYb", TestExternalId = "price_0OJ0FsqJFDZJcnkVfE87UKr6" });
Insert.IntoTable("Plans".ToLower()).Row(new { PlanId = 37, Name = "Entity Monthly", Cost = 0, Frequency = 2, ExternalId = "price_0OLxxPqJFDZJcnkVfJLISCp4", TestExternalId = "price_0OIzLPqJFDZJcnkVRn2tpwFF" });
Insert.IntoTable("Plans".ToLower()).Row(new { planid = 36, name = "Entity", cost = 0, frequency = 3, externalid = "price_0OLxxPqJFDZJcnkVDRHyMUYb", testexternalid = "price_0OJ0FsqJFDZJcnkVfE87UKr6" });
Insert.IntoTable("Plans".ToLower()).Row(new { planid = 37, name = "Entity Monthly", cost = 0, frequency = 2, externalid = "price_0OLxxPqJFDZJcnkVfJLISCp4", testexternalid = "price_0OIzLPqJFDZJcnkVRn2tpwFF" });


Insert.IntoTable("PlanLimits".ToLower()).Row(new { PlanId = 36, LimitType = 6, LimitValue = 10 }); // Entities Per Pack
Insert.IntoTable("PlanLimits".ToLower()).Row(new { PlanId = 37, LimitType = 6, LimitValue = 10 }); // Entities Per Pack
Insert.IntoTable("PlanLimits".ToLower()).Row(new { planlimitid = 6, planid = 36, limittype = 6, limitvalue = 10 }); // Entities Per Pack
Insert.IntoTable("PlanLimits".ToLower()).Row(new { planlimitid = 7, planid = 37, limittype = 6, limitvalue = 10 }); // Entities Per Pack

Insert.IntoTable("PlanAddons".ToLower()).Row(new { PlanAddonId = "04b6db64-7dbf-4b3d-a1d1-60bffde004b4", PlanId = 36, AddonType = 1, Cost = 30000, ExternalId = "price_0NMZrMqJFDZJcnkVTpb07W60", TestExternalId = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
Insert.IntoTable("PlanAddons".ToLower()).Row(new { PlanAddonId = "8f730f54-2574-445e-875a-5819f8bcda7a", PlanId = 37, AddonType = 1, Cost = 3000, ExternalId = "price_0NMZrMqJFDZJcnkVTpb07W60", TestExternalId = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
Insert.IntoTable("PlanAddons".ToLower()).Row(new { planaddonid = "04b6db64-7dbf-4b3d-a1d1-60bffde004b4", planid = 36, addontype = 1, cost = 30000, externalid = "price_0NMZrMqJFDZJcnkVTpb07W60", testexternalid = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
Insert.IntoTable("PlanAddons".ToLower()).Row(new { planaddonid = "8f730f54-2574-445e-875a-5819f8bcda7a", planid = 37, addontype = 1, cost = 3000, externalid = "price_0NMZrMqJFDZJcnkVTpb07W60", testexternalid = "price_0NLHvaqJFDZJcnkVS3DHnRA8" });
}

public override void Down()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class M0027_AddingFreeEntityLimits : Migration
{
public override void Up()
{
Insert.IntoTable("PlanLimits".ToLower()).Row(new { PlanId = 1, LimitType = 6, LimitValue = 10 });
Insert.IntoTable("PlanLimits".ToLower()).Row(new { planlimitid = 8, planid = 1, limittype = 6, limitvalue = 10 });
}

public override void Down()
Expand Down
5 changes: 2 additions & 3 deletions Tools/Resgrid.Console/Commands/DbUpdateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using Resgrid.Providers.Migrations.Migrations;
using FluentMigrator.Runner;
using Resgrid.Model.Repositories;
using Resgrid.Providers.MigrationsPg.Migrations;

namespace Resgrid.Console.Commands
Expand All @@ -22,8 +23,6 @@ public DbUpdateCommand(IConsole console)
public string Execute(DbUpdateArgs args)
{
_console.WriteLine("Starting the Resgrid Database Update Process");
WriteConnectionString();

_console.WriteLine("Please Wait...");

try
Expand Down Expand Up @@ -97,7 +96,7 @@ private static void UpdateDatabase(IServiceProvider serviceProvider)
{
// Instantiate the runner
var runner = serviceProvider.GetRequiredService<IMigrationRunner>();

// Execute the migrations
runner.MigrateUp();
}
Expand Down
Loading