-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b61d49
commit ef91f81
Showing
4 changed files
with
141 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 47 additions & 49 deletions
96
util/MySqlMigrations/Migrations/20241126185456_AddTable_OrganizationInstallation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,58 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.MySqlMigrations.Migrations | ||
namespace Bit.MySqlMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
InstallationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySql:CharSet", "utf8mb4"); | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
InstallationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySql:CharSet", "utf8mb4"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
} |
94 changes: 46 additions & 48 deletions
94
util/PostgresMigrations/Migrations/20241126185450_AddTable_OrganizationInstallation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,57 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.PostgresMigrations.Migrations | ||
namespace Bit.PostgresMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uuid", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false), | ||
InstallationId = table.Column<Guid>(type: "uuid", nullable: false), | ||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uuid", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false), | ||
InstallationId = table.Column<Guid>(type: "uuid", nullable: false), | ||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
} |
94 changes: 46 additions & 48 deletions
94
util/SqliteMigrations/Migrations/20241126185500_AddTable_OrganizationInstallation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,57 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.SqliteMigrations.Migrations | ||
namespace Bit.SqliteMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddTable_OrganizationInstallation : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "TEXT", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
InstallationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "TEXT", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "OrganizationInstallation", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "TEXT", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
InstallationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false), | ||
RevisionDate = table.Column<DateTime>(type: "TEXT", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OrganizationInstallation", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Installation_InstallationId", | ||
column: x => x.InstallationId, | ||
principalTable: "Installation", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_OrganizationInstallation_Organization_OrganizationId", | ||
column: x => x.OrganizationId, | ||
principalTable: "Organization", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_InstallationId", | ||
table: "OrganizationInstallation", | ||
column: "InstallationId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
migrationBuilder.CreateIndex( | ||
name: "IX_OrganizationInstallation_OrganizationId", | ||
table: "OrganizationInstallation", | ||
column: "OrganizationId"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OrganizationInstallation"); | ||
} | ||
} |