mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Default autoscaling to off (#1659)
* Default autoscaling to off * Update util/Migrator/DbScripts/2021-10-21_00_DefaultAutoscaleLimitToCurrentSeats.sql Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com> * Update util/Migrator/DbScripts/2021-10-21_00_DefaultAutoscaleLimitToCurrentSeats.sql Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com> * Update util/MySqlMigrations/Scripts/2021-10-21_00_SetMaxAutoscaleSeatCount.sql Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
This commit is contained in:
1501
util/PostgresMigrations/Migrations/20211021204521_SetMaxAutoscaleSeatsToCurrentSeatCount.Designer.cs
generated
Normal file
1501
util/PostgresMigrations/Migrations/20211021204521_SetMaxAutoscaleSeatsToCurrentSeatCount.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations
|
||||
{
|
||||
public partial class SetMaxAutoscaleSeatsToCurrentSeatCount : Migration
|
||||
{
|
||||
private const string _scriptLocation =
|
||||
"PostgresMigration.Scripts.2021-10-21_00_SetMaxAutoscaleSeatCount.sql";
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
throw new Exception("Irreversible migration");
|
||||
}
|
||||
}
|
||||
}
|
@ -18,8 +18,10 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Scripts\2021-09-21_01_SplitManageCollectionsPermission.psql" />
|
||||
<None Remove="Scripts\2021-10-21_00_SetMaxAutoscaleSeatCount.psql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Scripts\2021-09-21_01_SplitManageCollectionsPermission.psql" />
|
||||
<EmbeddedResource Include="Scripts\2021-10-21_00_SetMaxAutoscaleSeatCount.psql" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -0,0 +1,4 @@
|
||||
UPDATE "Organization"
|
||||
SET "MaxAutoscaleSeats" = "Seats"
|
||||
WHERE NOT EXISTS (SELECT 1 FROM "Organization" WHERE "MaxAutoscaleSeats" IS NOT NULL LIMIT 1)
|
||||
AND NOT EXISTS (SELECT 1 FROM "Organization" WHERE "OwnersNotifiedOfAutoscaling" IS NOT NULL LIMIT 1)
|
Reference in New Issue
Block a user