1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 21:18:13 -05:00
bitwarden/util/PostgresMigrations/Migrations/20220420171153_AddInstallationIdToEvents.cs
Justin Baur bae03feffe
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d15cb84a893703ee5a8b33a2d67ad3d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2aa78deb84d4cbc359992a7c6bba7ea5.
2022-08-29 15:53:48 -04:00

66 lines
2.4 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.PostgresMigrations.Migrations
{
public partial class AddInstallationIdToEvents : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganization~",
table: "OrganizationSponsorship");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AddColumn<Guid>(
name: "InstallationId",
table: "Event",
type: "uuid",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganization~",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganization~",
table: "OrganizationSponsorship");
migrationBuilder.DropColumn(
name: "InstallationId",
table: "Event");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganization~",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}