mirror of
https://github.com/bitwarden/server.git
synced 2026-06-01 01:55:55 -05:00
* Add UseInviteLinks to Organization SQL schema and views * Add Migrator scripts for UseInviteLinks column and data migration * Add EF migrations for UseInviteLinks on Organization * Wire UseInviteLinks through organization domain and repositories * Add HasInviteLinks plan support and UseInviteLinks license handling * Expose UseInviteLinks and HasInviteLinks on organization and plan API models * Update tests for UseInviteLinks and invite-links plan feature * Update migration script with missing update to Organization_ReadManyByIds * Move UseInviteLinks column after ExemptFromBillingAutomation * Bump date on migration scripts
30 lines
815 B
C#
30 lines
815 B
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Bit.PostgresMigrations.Migrations;
|
|
|
|
/// <inheritdoc />
|
|
public partial class UseInviteLinksDataMigration : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.Sql(@"
|
|
UPDATE ""Organization""
|
|
SET ""UseInviteLinks"" = true
|
|
WHERE ""PlanType"" IN (4, 5, 10, 11, 14, 15, 19, 20);
|
|
");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.Sql(@"
|
|
UPDATE ""Organization""
|
|
SET ""UseInviteLinks"" = false
|
|
WHERE ""PlanType"" IN (4, 5, 10, 11, 14, 15, 19, 20);
|
|
");
|
|
}
|
|
}
|