mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
dotnet format
This commit is contained in:
@@ -10,7 +10,6 @@ using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data.Organizations;
|
||||
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Infrastructure.EntityFramework.Models;
|
||||
using LinqToDB.Tools;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -1,52 +1,50 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations
|
||||
namespace Bit.MySqlMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,49 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations
|
||||
namespace Bit.PostgresMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,49 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.SqliteMigrations.Migrations
|
||||
namespace Bit.SqliteMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DefaultCollectionOwnerIdColumn : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection",
|
||||
columns: new[] { "DefaultCollectionOwnerId", "OrganizationId", "Type" },
|
||||
unique: true,
|
||||
filter: "\"Type\" = 1");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection",
|
||||
column: "DefaultCollectionOwnerId",
|
||||
principalTable: "OrganizationUser",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Collection_OrganizationUser_DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Collection_DefaultCollectionOwnerId_OrganizationId_Type",
|
||||
table: "Collection");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultCollectionOwnerId",
|
||||
table: "Collection");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user