127 lines
3.9 KiB
C#
127 lines
3.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ManagerService.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AiQuotaTokensInsteadOfRequests : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "AiRequestsPerMonth",
|
|
table: "SubscriptionPlans");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "AiRequestsPerMonth",
|
|
table: "Instances");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "AiRequestsThisMonth",
|
|
table: "Instances");
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "AiTokensPerMonth",
|
|
table: "SubscriptionPlans",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "AiTokensPerMonth",
|
|
table: "Instances",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "AiTokensThisMonth",
|
|
table: "Instances",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-premium",
|
|
column: "AiTokensPerMonth",
|
|
value: 20000000L);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-standard",
|
|
column: "AiTokensPerMonth",
|
|
value: 5000000L);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-starter",
|
|
column: "AiTokensPerMonth",
|
|
value: 0L);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "AiTokensPerMonth",
|
|
table: "SubscriptionPlans");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "AiTokensPerMonth",
|
|
table: "Instances");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "AiTokensThisMonth",
|
|
table: "Instances");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "AiRequestsPerMonth",
|
|
table: "SubscriptionPlans",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "AiRequestsPerMonth",
|
|
table: "Instances",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "AiRequestsThisMonth",
|
|
table: "Instances",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-premium",
|
|
column: "AiRequestsPerMonth",
|
|
value: 2000);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-standard",
|
|
column: "AiRequestsPerMonth",
|
|
value: 500);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "SubscriptionPlans",
|
|
keyColumn: "Id",
|
|
keyValue: "plan-starter",
|
|
column: "AiRequestsPerMonth",
|
|
value: 0);
|
|
}
|
|
}
|
|
}
|