mirror of
https://github.com/bitwarden/server.git
synced 2026-06-01 01:55:55 -05:00
* Add feature flag for Organization Invite Links * Add OrganizationInviteLink database entity * Add OrganizationInviteLink table sql script and also OrganizationInviteLinkView that reads from it * Add OrganizationInviteLink stored procedures for CRUD operations * Add SQL migration script * Add EF migrations * Add EF configurations * Add IOrganizationInviteLinkRepository and integration tests * Add OrganizationInviteLinkRepository Dapper implementation * refactor(tests): Update OrganizationInviteLinkRepositoryTests to use [Theory] attribute for test cases
57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Bit.PostgresMigrations.Migrations;
|
|
|
|
/// <inheritdoc />
|
|
public partial class CreateOrganizationInviteLink : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "OrganizationInviteLink",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Code = table.Column<Guid>(type: "uuid", nullable: false),
|
|
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
AllowedDomains = table.Column<string>(type: "text", nullable: false),
|
|
EncryptedInviteKey = table.Column<string>(type: "text", nullable: false),
|
|
EncryptedOrgKey = table.Column<string>(type: "text", nullable: true),
|
|
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_OrganizationInviteLink", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_OrganizationInviteLink_Organization_OrganizationId",
|
|
column: x => x.OrganizationId,
|
|
principalTable: "Organization",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_OrganizationInviteLink_Code",
|
|
table: "OrganizationInviteLink",
|
|
column: "Code",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_OrganizationInviteLink_OrganizationId",
|
|
table: "OrganizationInviteLink",
|
|
column: "OrganizationId",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "OrganizationInviteLink");
|
|
}
|
|
}
|