1
0
mirror of https://github.com/bitwarden/server synced 2026-01-11 13:03:27 +00:00

remove migrations not intended for merge

This commit is contained in:
John Harrington
2025-12-18 10:59:35 -07:00
parent af39424274
commit 7df56e346a
733 changed files with 0 additions and 913796 deletions

View File

@@ -1,51 +0,0 @@
using Bit.Core.Settings;
using Bit.Infrastructure.EntityFramework.Repositories;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Bit.MySqlMigrations;
public class GlobalSettingsFactory
{
public GlobalSettings GlobalSettings { get; }
public GlobalSettingsFactory(string[] args)
{
GlobalSettings = new GlobalSettings();
// UserSecretsId here should match what is in Api.csproj
var config = new ConfigurationBuilder()
.AddUserSecrets("bitwarden-Api")
.AddCommandLine(args)
.Build();
config.GetSection("GlobalSettings").Bind(GlobalSettings);
}
}
public class DatabaseContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
{
public DatabaseContext CreateDbContext(string[] args)
{
var services = new ServiceCollection();
services.AddDataProtection();
var serviceProvider = services.BuildServiceProvider();
var globalSettings = new GlobalSettingsFactory(args)
.GlobalSettings;
var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
var connectionString = globalSettings.MySql?.ConnectionString;
if (string.IsNullOrWhiteSpace(connectionString))
{
throw new Exception("No MySql connection string found.");
}
optionsBuilder.UseMySql(
connectionString,
ServerVersion.AutoDetect(connectionString),
b => b.MigrationsAssembly("MySqlMigrations"))
.UseApplicationServiceProvider(serviceProvider);
return new DatabaseContext(optionsBuilder.Options);
}
}

View File

@@ -1,56 +0,0 @@
-- Split Manage Assigned Collections into edit and delete
UPDATE `OrganizationUser`
SET `Permissions` =
JSON_INSERT(
`Permissions`,
'$.editAssignedCollections',
IFNULL(
IFNULL(
JSON_EXTRACT(`Permissions`,'$.editAssignedCollections'),
JSON_EXTRACT(`Permissions`, '$.manageAssignedCollections')),
false),
'$.deleteAssignedCollections',
IFNULL(
IFNULL(
JSON_EXTRACT(`Permissions`, '$.deleteAssignedCollections'),
JSON_EXTRACT(`Permissions`, '$.manageAssignedCollections')),
false)
)
WHERE `Permissions` IS NOT NULL
AND JSON_VALID(`Permissions`) > 0
AND (
JSON_EXTRACT(`Permissions`, '$.editAssignedCollections') IS NULL
OR JSON_EXTRACT(`Permissions`, '$.deleteAssignedCollections') IS NULL
);
-- Split Manage All Collections into create, edit, and delete
UPDATE `OrganizationUser`
SET `Permissions` =
JSON_INSERT(
`Permissions`,
'$.createNewCollections',
IFNULL(
IFNULL(
JSON_EXTRACT(`Permissions`, '$.createNewColletions'),
JSON_EXTRACT(`Permissions`, '$.manageAllCollections')),
false),
'$.editAnyCollection',
IFNULL(
IFNULL(
JSON_EXTRACT(`Permissions`, '$.editAnyCollection'),
JSON_EXTRACT(`Permissions`, '$.manageAllCollections')),
false),
'$.deleteAnyCollection',
IFNULL(
IFNULL(
JSON_EXTRACT(`Permissions`, '$.deleteAnyCollection'),
JSON_EXTRACT(`Permissions`, '$.manageAllCollections')),
false)
)
WHERE `Permissions` IS NOT NULL
AND JSON_VALID(`Permissions`) > 0
AND (
JSON_EXTRACT(`Permissions`, '$.createNewCollections') IS NULL
OR JSON_EXTRACT(`Permissions`, '$.editAnyCollection') IS NULL
OR JSON_EXTRACT(`Permissions`, '$.deleteAnyCollection') IS NULL
);

View File

@@ -1,20 +0,0 @@
SET @run_migration_seats = 0;
SELECT 1 FROM `Organization`
WHERE `MaxAutoscaleSeats` IS NOT NULL
LIMIT 1
INTO @run_migration_seats;
SET @run_migration_email = 0;
SELECT 1 FROM `Organization`
WHERE `OwnersNotifiedOfAutoscaling` IS NOT NULL
LIMIT 1
INTO @run_migration_email;
SET @stmt = case @run_migration_seats + @run_migration_email
WHEN 0 THEN 'UPDATE `Organization` SET `MaxAutoscaleSeats` = `Seats`'
ELSE 'SELECT ''No migration necessary'''
END;
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -1,3 +0,0 @@
UPDATE Organization
INNER JOIN OrganizationApiKey ON (Organization.Id = OrganizationApiKey.OrganizationId)
SET Organization.ApiKey = OrganizationApiKey.ApiKey;

View File

@@ -1,3 +0,0 @@
INSERT INTO OrganizationApiKey(Id, OrganizationId, Type, ApiKey, RevisionDate)
SELECT UUID(), Id, 0, ApiKey, RevisionDate
FROM Organization;

View File

@@ -1,21 +0,0 @@
START TRANSACTION;
CREATE TABLE `OrganizationDomain` (
`Id` char(36) COLLATE ascii_general_ci NOT NULL,
`OrganizationId` char(36) COLLATE ascii_general_ci NOT NULL,
`Txt` longtext CHARACTER SET utf8mb4 NULL,
`DomainName` varchar(255) CHARACTER SET utf8mb4 NULL,
`CreationDate` datetime(6) NOT NULL,
`VerifiedDate` datetime(6) NULL,
`NextRunDate` datetime(6) NOT NULL,
`NextRunCount` int NOT NULL,
CONSTRAINT `PK_OrganizationDomain` PRIMARY KEY (`Id`),
CONSTRAINT `FK_OrganizationDomain_Organization_OrganizationId` FOREIGN KEY (`OrganizationId`) REFERENCES `Organization` (`Id`) ON DELETE CASCADE
) CHARACTER SET=utf8mb4;
CREATE INDEX `IX_OrganizationDomain_OrganizationId` ON `OrganizationDomain` (`OrganizationId`);
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
VALUES ('20221108015516_OrganizationDomainClaim', '6.0.4');
COMMIT;

View File

@@ -1,8 +0,0 @@
START TRANSACTION;
ALTER TABLE `OrganizationDomain` RENAME COLUMN `NextRunCount` TO `JobRunCount`;
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
VALUES ('20221129004644_OrganizationDomainClaimRenameNextRunCount', '6.0.4');
COMMIT;

View File

@@ -1,9 +0,0 @@
START TRANSACTION;
ALTER TABLE `Event` ADD `DomainName` longtext CHARACTER SET utf8mb4 NULL;
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
VALUES ('20221209015017_EventsDomainName', '6.0.4');
COMMIT;

View File

@@ -1,9 +0,0 @@
START TRANSACTION;
ALTER TABLE `OrganizationDomain` ADD `LastCheckedDate` datetime(6) NULL;
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
VALUES ('20221209192355_OrganizationDomainLastCheckedDate', '6.0.4');
COMMIT;

View File

@@ -1,140 +0,0 @@
-- Step 1: AccessAll migration for Groups
-- Create a temporary table to store the groups with AccessAll = 1
CREATE TEMPORARY TABLE `TempGroupsAccessAll` AS
SELECT `G`.`Id` AS `GroupId`,
`G`.`OrganizationId`
FROM `Group` `G`
INNER JOIN `Organization` `O` ON `G`.`OrganizationId` = `O`.`Id`
WHERE `O`.`FlexibleCollections` = 0 AND `G`.`AccessAll` = 1;
-- Step 2: AccessAll migration for OrganizationUsers
-- Create a temporary table to store the OrganizationUsers with AccessAll = 1
CREATE TEMPORARY TABLE `TempUsersAccessAll` AS
SELECT `OU`.`Id` AS `OrganizationUserId`,
`OU`.`OrganizationId`
FROM `OrganizationUser` `OU`
INNER JOIN `Organization` `O` ON `OU`.`OrganizationId` = `O`.`Id`
WHERE `O`.`FlexibleCollections` = 0 AND `OU`.`AccessAll` = 1;
-- Step 3: For all OrganizationUsers with Manager role or 'EditAssignedCollections' permission update their existing CollectionUsers rows and insert new rows with [Manage] = 1
-- and finally update all OrganizationUsers with Manager role to User role
-- Create a temporary table to store the OrganizationUsers with Manager role or 'EditAssignedCollections' permission
CREATE TEMPORARY TABLE `TempUserManagers` AS
SELECT `OU`.`Id` AS `OrganizationUserId`,
`OU`.`OrganizationId`,
CASE WHEN `OU`.`Type` = 3 THEN 1 ELSE 0 END AS `IsManager`
FROM `OrganizationUser` `OU`
INNER JOIN `Organization` `O` ON `OU`.`OrganizationId` = `O`.`Id`
WHERE `O`.`FlexibleCollections` = 0 AND
(`OU`.`Type` = 3 OR
(`OU`.`Type` = 4 AND
`OU`.`Permissions` IS NOT NULL AND
JSON_VALID(`OU`.`Permissions`) AND JSON_VALUE(`OU`.`Permissions`, '$.editAssignedCollections') = 'true'));
-- Step 1
-- Update existing rows in `CollectionGroups`
UPDATE `CollectionGroups` `CG`
INNER JOIN `Collection` `C` ON `CG`.`CollectionId` = `C`.`Id`
INNER JOIN `TempGroupsAccessAll` `TG` ON `CG`.`GroupId` = `TG`.`GroupId`
SET `CG`.`ReadOnly` = 0,
`CG`.`HidePasswords` = 0,
`CG`.`Manage` = 0
WHERE `CG`.`CollectionId` = `C`.`Id` AND `C`.`OrganizationId` = `TG`.`OrganizationId`;
-- Insert new rows into `CollectionGroups`
INSERT INTO `CollectionGroups` (`CollectionId`, `GroupId`, `ReadOnly`, `HidePasswords`, `Manage`)
SELECT `C`.`Id`, `TG`.`GroupId`, 0, 0, 0
FROM `Collection` `C`
INNER JOIN `TempGroupsAccessAll` `TG` ON `C`.`OrganizationId` = `TG`.`OrganizationId`
LEFT JOIN `CollectionGroups` `CG` ON `CG`.`CollectionId` = `C`.`Id` AND `CG`.`GroupId` = `TG`.`GroupId`
WHERE `CG`.`CollectionId` IS NULL;
-- Update `Group` to clear `AccessAll` flag and update `RevisionDate`
UPDATE `Group` `G`
SET `AccessAll` = 0, `RevisionDate` = UTC_TIMESTAMP()
WHERE `G`.`Id` IN (SELECT `GroupId` FROM `TempGroupsAccessAll`);
-- Step 2
-- Update existing rows in `CollectionUsers`
UPDATE `CollectionUsers` `CU`
INNER JOIN `Collection` `C` ON `CU`.`CollectionId` = `C`.`Id`
INNER JOIN `TempUsersAccessAll` `TU`
ON `C`.`OrganizationId` = `TU`.`OrganizationId` AND `CU`.`OrganizationUserId` = `TU`.`OrganizationUserId`
SET `CU`.`ReadOnly` = 0,
`CU`.`HidePasswords` = 0,
`CU`.`Manage` = 0
WHERE `CU`.`CollectionId` = `C`.`Id`;
-- Insert new rows into `CollectionUsers`
INSERT INTO `CollectionUsers` (`CollectionId`, `OrganizationUserId`, `ReadOnly`, `HidePasswords`, `Manage`)
SELECT `C`.`Id`, `TU`.`OrganizationUserId`, 0, 0, 0
FROM `Collection` `C`
INNER JOIN `TempUsersAccessAll` `TU` ON `C`.`OrganizationId` = `TU`.`OrganizationId`
LEFT JOIN `CollectionUsers` `target`
ON `target`.`CollectionId` = `C`.`Id` AND `target`.`OrganizationUserId` = `TU`.`OrganizationUserId`
WHERE `target`.`CollectionId` IS NULL;
-- Update `OrganizationUser` to clear `AccessAll` flag
UPDATE `OrganizationUser` `OU`
SET `AccessAll` = 0, `RevisionDate` = UTC_TIMESTAMP()
WHERE `OU`.`Id` IN (SELECT `OrganizationUserId` FROM `TempUsersAccessAll`);
-- Step 3
-- Update `CollectionUsers` with `Manage` = 1 using the temporary table
UPDATE `CollectionUsers` `CU`
INNER JOIN `TempUserManagers` `TUM` ON `CU`.`OrganizationUserId` = `TUM`.`OrganizationUserId`
SET `CU`.`ReadOnly` = 0,
`CU`.`HidePasswords` = 0,
`CU`.`Manage` = 1;
-- Insert rows to `CollectionUsers` with `Manage` = 1 using the temporary table
-- This is for orgUsers who are Managers / EditAssignedCollections but have access via a group
-- We cannot give the whole group Manage permissions so we have to give them a direct assignment
INSERT INTO `CollectionUsers` (`CollectionId`, `OrganizationUserId`, `ReadOnly`, `HidePasswords`, `Manage`)
SELECT DISTINCT `CG`.`CollectionId`, `TUM`.`OrganizationUserId`, 0, 0, 1
FROM `CollectionGroups` `CG`
INNER JOIN `GroupUser` `GU` ON `CG`.`GroupId` = `GU`.`GroupId`
INNER JOIN `TempUserManagers` `TUM` ON `GU`.`OrganizationUserId` = `TUM`.`OrganizationUserId`
WHERE NOT EXISTS (
SELECT 1 FROM `CollectionUsers` `CU`
WHERE `CU`.`CollectionId` = `CG`.`CollectionId` AND `CU`.`OrganizationUserId` = `TUM`.`OrganizationUserId`
);
-- Update `OrganizationUser` to migrate all OrganizationUsers with Manager role to User role
UPDATE `OrganizationUser` `OU`
SET `OU`.`Type` = 2, `OU`.`RevisionDate` = UTC_TIMESTAMP() -- User
WHERE `OU`.`Id` IN (SELECT `OrganizationUserId` FROM `TempUserManagers` WHERE `IsManager` = 1);
-- Step 4
-- Update `User` `AccountRevisionDate` for each unique `OrganizationUserId`
UPDATE `User` `U`
INNER JOIN `OrganizationUser` `OU` ON `U`.`Id` = `OU`.`UserId`
INNER JOIN (
-- Step 1
SELECT `GU`.`OrganizationUserId`
FROM `GroupUser` `GU`
INNER JOIN `TempGroupsAccessAll` `TG` ON `GU`.`GroupId` = `TG`.`GroupId`
UNION
-- Step 2
SELECT `OrganizationUserId`
FROM `TempUsersAccessAll`
UNION
-- Step 3
SELECT `OrganizationUserId`
FROM `TempUserManagers`
) AS `CombinedOrgUsers` ON `OU`.`Id` = `CombinedOrgUsers`.`OrganizationUserId`
SET `U`.`AccountRevisionDate` = UTC_TIMESTAMP();
-- Step 5: Set `FlexibleCollections` = 1 for all organizations that have not yet been migrated.
UPDATE `Organization`
SET `FlexibleCollections` = 1
WHERE `FlexibleCollections` = 0;
-- Step 6: Drop the temporary tables
DROP TEMPORARY TABLE IF EXISTS `TempGroupsAccessAll`;
DROP TEMPORARY TABLE IF EXISTS `TempUsersAccessAll`;
DROP TEMPORARY TABLE IF EXISTS `TempUserManagers`;

View File

@@ -1,41 +0,0 @@
-- Migrate Custom users who only have 'editAssignedCollections' and/or 'deleteAssignedCollections' custom permissions to the User type.
UPDATE `OrganizationUser`
SET
`Type` = 2,
`Permissions` = NULL
WHERE
`Type` = 4
AND JSON_VALID(`Permissions`) = 1
AND (
JSON_VALUE(`Permissions`, '$.editAssignedCollections') = 'true'
OR JSON_VALUE(`Permissions`, '$.deleteAssignedCollections') = 'true'
)
AND JSON_VALUE(`Permissions`, '$.accessEventLogs') = 'false'
AND JSON_VALUE(`Permissions`, '$.accessImportExport') = 'false'
AND JSON_VALUE(`Permissions`, '$.accessReports') = 'false'
AND JSON_VALUE(`Permissions`, '$.createNewCollections') = 'false'
AND JSON_VALUE(`Permissions`, '$.editAnyCollection') = 'false'
AND JSON_VALUE(`Permissions`, '$.deleteAnyCollection') = 'false'
AND JSON_VALUE(`Permissions`, '$.manageGroups') = 'false'
AND JSON_VALUE(`Permissions`, '$.managePolicies') = 'false'
AND JSON_VALUE(`Permissions`, '$.manageSso') = 'false'
AND JSON_VALUE(`Permissions`, '$.manageUsers') = 'false'
AND JSON_VALUE(`Permissions`, '$.manageResetPassword') = 'false'
AND JSON_VALUE(`Permissions`, '$.manageScim') = 'false';
-- Remove 'editAssignedCollections' and 'deleteAssignedCollections' properties from Permissions
UPDATE `OrganizationUser`
SET
`Permissions` = JSON_REMOVE(
JSON_REMOVE(
`Permissions`,
'$.editAssignedCollections'
),
'$.deleteAssignedCollections'
)
WHERE
JSON_VALID(`Permissions`) = 1
AND (
JSON_VALUE(`Permissions`, '$.editAssignedCollections') IS NOT NULL
OR JSON_VALUE(`Permissions`, '$.deleteAssignedCollections') IS NOT NULL
);

View File

@@ -1,29 +0,0 @@
/* Update User Table */
UPDATE
`User` U
SET
U.TwoFactorProviders = JSON_SET(
JSON_SET(
U.TwoFactorProviders, '$."2".MetaData.ClientSecret',
JSON_UNQUOTE(JSON_EXTRACT(U.TwoFactorProviders,'$."2".MetaData.SKey'))),
'$."2".MetaData.ClientId',
JSON_UNQUOTE(JSON_EXTRACT(U.TwoFactorProviders,'$."2".MetaData.IKey')))
WHERE
JSON_CONTAINS(TwoFactorProviders,
'{"2":{}}')
AND JSON_VALID(TwoFactorProviders);
/* Update Organization Table */
UPDATE
Organization o
SET
o.TwoFactorProviders = JSON_SET(
JSON_SET(
o.TwoFactorProviders, '$."6".MetaData.ClientSecret',
JSON_UNQUOTE(JSON_EXTRACT(o.TwoFactorProviders,'$."6".MetaData.SKey'))),
'$."6".MetaData.ClientId',
JSON_UNQUOTE(JSON_EXTRACT(o.TwoFactorProviders,'$."6".MetaData.IKey')))
WHERE
JSON_CONTAINS(o.TwoFactorProviders,
'{"6":{}}')
AND JSON_VALID(o.TwoFactorProviders);

View File

@@ -1,3 +0,0 @@
UPDATE Organization
SET UseOrganizationDomains = UseSso
WHERE UseSso = 1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,89 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class RemoveProviderOrganizationProviderUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProviderOrganizationProviderUser");
migrationBuilder.AddColumn<bool>(
name: "UseEvents",
table: "Provider",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<Guid>(
name: "ProviderId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ProviderUserId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UseEvents",
table: "Provider");
migrationBuilder.DropColumn(
name: "ProviderId",
table: "Event");
migrationBuilder.DropColumn(
name: "ProviderUserId",
table: "Event");
migrationBuilder.CreateTable(
name: "ProviderOrganizationProviderUser",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Permissions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderOrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProviderUserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Type = table.Column<byte>(type: "tinyint unsigned", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProviderOrganizationProviderUser", x => x.Id);
table.ForeignKey(
name: "FK_ProviderOrganizationProviderUser_ProviderOrganization_Provid~",
column: x => x.ProviderOrganizationId,
principalTable: "ProviderOrganization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProviderOrganizationProviderUser_ProviderUser_ProviderUserId",
column: x => x.ProviderUserId,
principalTable: "ProviderUser",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ProviderOrganizationProviderUser_ProviderOrganizationId",
table: "ProviderOrganizationProviderUser",
column: "ProviderOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_ProviderOrganizationProviderUser_ProviderUserId",
table: "ProviderOrganizationProviderUser",
column: "ProviderUserId");
}
}

View File

@@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class UserForcePasswordReset : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "ForcePasswordReset",
table: "User",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ForcePasswordReset",
table: "User");
}
}

View File

@@ -1,43 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class AddMaxAutoscaleSeatsToOrganization : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "MaxAutoscaleSeats",
table: "Organization",
type: "int",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "OwnersNotifiedOfAutoscaling",
table: "Organization",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "ProviderOrganizationId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MaxAutoscaleSeats",
table: "Organization");
migrationBuilder.DropColumn(
name: "OwnersNotifiedOfAutoscaling",
table: "Organization");
migrationBuilder.DropColumn(
name: "ProviderOrganizationId",
table: "Event");
}
}

View File

@@ -1,20 +0,0 @@
using Bit.Core.Utilities;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class SplitManageCollectionsPermissions2 : Migration
{
private const string _scriptLocation =
"MySqlMigrations.HelperScripts.2021-09-21_01_SplitManageCollectionsPermission.sql";
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
throw new Exception("Irreversible migration");
}
}

View File

@@ -1,20 +0,0 @@
using Bit.Core.Utilities;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class SetMaxAutoscaleSeatsToCurrentSeatCount : Migration
{
private const string _scriptLocation =
"MySqlMigrations.HelperScripts.2021-10-21_00_SetMaxAutoscaleSeatCount.sql";
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
throw new Exception("Irreversible migration");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class KeyConnector : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UsesKeyConnector",
table: "User",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UsesKeyConnector",
table: "User");
}
}

View File

@@ -1,84 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class OrganizationSponsorship : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UsesCryptoAgent",
table: "User",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "OrganizationSponsorship",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
InstallationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
SponsoringOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
SponsoringOrganizationUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
SponsoredOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
FriendlyName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OfferedToEmail = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PlanSponsorshipType = table.Column<byte>(type: "tinyint unsigned", nullable: true),
CloudSponsor = table.Column<bool>(type: "tinyint(1)", nullable: false),
LastSyncDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TimesRenewedWithoutValidation = table.Column<byte>(type: "tinyint unsigned", nullable: false),
SponsorshipLapsedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationSponsorship", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationSponsorship_Installation_InstallationId",
column: x => x.InstallationId,
principalTable: "Installation",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoredOrganizationId",
column: x => x.SponsoredOrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
column: x => x.SponsoringOrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationSponsorship_InstallationId",
table: "OrganizationSponsorship",
column: "InstallationId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationSponsorship_SponsoredOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoredOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationSponsorship_SponsoringOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrganizationSponsorship");
migrationBuilder.DropColumn(
name: "UsesCryptoAgent",
table: "User");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class KeyConnectorFlag : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UseKeyConnector",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UseKeyConnector",
table: "Organization");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class RemoveU2F : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "U2f");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "U2f",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AppId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Challenge = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
KeyHandle = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Version = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_U2f", x => x.Id);
table.ForeignKey(
name: "FK_U2f_User_UserId",
column: x => x.UserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_U2f_UserId",
table: "U2f",
column: "UserId");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,33 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class FailedLoginCaptcha : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "FailedLoginCount",
table: "User",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<DateTime>(
name: "LastFailedLoginDate",
table: "User",
type: "datetime(6)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "FailedLoginCount",
table: "User");
migrationBuilder.DropColumn(
name: "LastFailedLoginDate",
table: "User");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,158 +0,0 @@
using Bit.EfShared;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class SelfHostF4E : Migration
{
private const string _scriptLocationTemplate = "2022-03-01_00_{0}_MigrateOrganizationApiKeys.sql";
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Installation_InstallationId",
table: "OrganizationSponsorship");
migrationBuilder.DropIndex(
name: "IX_OrganizationSponsorship_InstallationId",
table: "OrganizationSponsorship");
migrationBuilder.DropColumn(
name: "InstallationId",
table: "OrganizationSponsorship");
migrationBuilder.DropColumn(
name: "TimesRenewedWithoutValidation",
table: "OrganizationSponsorship");
migrationBuilder.CreateTable(
name: "OrganizationApiKey",
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"),
Type = table.Column<byte>(type: "tinyint unsigned", nullable: false),
ApiKey = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationApiKey", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationApiKey_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.SqlResource(_scriptLocationTemplate);
migrationBuilder.DropColumn(
name: "ApiKey",
table: "Organization");
migrationBuilder.RenameColumn(
name: "SponsorshipLapsedDate",
table: "OrganizationSponsorship",
newName: "ValidUntil");
migrationBuilder.RenameColumn(
name: "CloudSponsor",
table: "OrganizationSponsorship",
newName: "ToDelete");
migrationBuilder.CreateTable(
name: "OrganizationConnection",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<byte>(type: "tinyint unsigned", nullable: false),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
Config = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationConnection", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationConnection_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationApiKey_OrganizationId",
table: "OrganizationApiKey",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationConnection_OrganizationId",
table: "OrganizationConnection",
column: "OrganizationId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ApiKey",
table: "Organization",
type: "varchar(30)",
maxLength: 30,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.SqlResource(_scriptLocationTemplate);
migrationBuilder.DropTable(
name: "OrganizationApiKey");
migrationBuilder.DropTable(
name: "OrganizationConnection");
migrationBuilder.RenameColumn(
name: "ValidUntil",
table: "OrganizationSponsorship",
newName: "SponsorshipLapsedDate");
migrationBuilder.RenameColumn(
name: "ToDelete",
table: "OrganizationSponsorship",
newName: "CloudSponsor");
migrationBuilder.AddColumn<Guid>(
name: "InstallationId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<byte>(
name: "TimesRenewedWithoutValidation",
table: "OrganizationSponsorship",
type: "tinyint unsigned",
nullable: false,
defaultValue: (byte)0);
migrationBuilder.CreateIndex(
name: "IX_OrganizationSponsorship_InstallationId",
table: "OrganizationSponsorship",
column: "InstallationId");
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Installation_InstallationId",
table: "OrganizationSponsorship",
column: "InstallationId",
principalTable: "Installation",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}

View File

@@ -1,80 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class SponsorshipBulkActions : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationUserId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationUserId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}

View File

@@ -1,69 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class AddInstallationIdToEvents : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "InstallationId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship");
migrationBuilder.DropColumn(
name: "InstallationId",
table: "Event");
migrationBuilder.AlterColumn<Guid>(
name: "SponsoringOrganizationId",
table: "OrganizationSponsorship",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_OrganizationSponsorship_Organization_SponsoringOrganizationId",
table: "OrganizationSponsorship",
column: "SponsoringOrganizationId",
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}

View File

@@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class DeviceUnknownVerification : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UnknownDeviceVerificationEnabled",
table: "User",
type: "tinyint(1)",
nullable: false,
defaultValue: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UnknownDeviceVerificationEnabled",
table: "User");
}
}

View File

@@ -1,28 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations;
public partial class DeactivatedUserStatus : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<short>(
name: "Status",
table: "OrganizationUser",
type: "smallint",
nullable: false,
oldClrType: typeof(byte),
oldType: "tinyint unsigned");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<byte>(
name: "Status",
table: "OrganizationUser",
type: "tinyint unsigned",
nullable: false,
oldClrType: typeof(short),
oldType: "smallint");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class UseScimFlag : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UseScim",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UseScim",
table: "Organization");
}
}

View File

@@ -1,71 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class PasswordlessAuthRequests : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AuthRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<byte>(type: "tinyint unsigned", nullable: false),
RequestDeviceIdentifier = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RequestDeviceType = table.Column<byte>(type: "tinyint unsigned", nullable: false),
RequestIpAddress = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RequestFingerprint = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ResponseDeviceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AccessCode = table.Column<string>(type: "varchar(25)", maxLength: 25, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PublicKey = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MasterPasswordHash = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ResponseDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
AuthenticationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AuthRequest", x => x.Id);
table.ForeignKey(
name: "FK_AuthRequest_Device_ResponseDeviceId",
column: x => x.ResponseDeviceId,
principalTable: "Device",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AuthRequest_User_UserId",
column: x => x.UserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AuthRequest_ResponseDeviceId",
table: "AuthRequest",
column: "ResponseDeviceId");
migrationBuilder.CreateIndex(
name: "IX_AuthRequest_UserId",
table: "AuthRequest",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AuthRequest");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class EventsSystemUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<byte>(
name: "SystemUser",
table: "Event",
type: "tinyint unsigned",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SystemUser",
table: "Event");
}
}

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class UseCustomPermissionsFlag : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UseCustomPermissions",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UseCustomPermissions",
table: "Organization");
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class PasswordlessAuthRequestAddApprovedColumn : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Approved",
table: "AuthRequest",
type: "tinyint(1)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Approved",
table: "AuthRequest");
}
}

View File

@@ -1,49 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class OrganizationDomainClaim : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OrganizationDomain",
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"),
Txt = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DomainName = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
VerifiedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
NextRunDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
NextRunCount = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationDomain", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationDomain_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationDomain_OrganizationId",
table: "OrganizationDomain",
column: "OrganizationId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrganizationDomain");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class AvatarColor : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AvatarColor",
table: "User",
type: "varchar(7)",
maxLength: 7,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AvatarColor",
table: "User");
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class OrganizationDomainClaimRenameNextRunCount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "NextRunCount",
table: "OrganizationDomain",
newName: "JobRunCount");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "JobRunCount",
table: "OrganizationDomain",
newName: "NextRunCount");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class EventsDomainName : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DomainName",
table: "Event",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DomainName",
table: "Event");
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class OrganizationDomainLastCheckedDate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "LastCheckedDate",
table: "OrganizationDomain",
type: "datetime(6)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LastCheckedDate",
table: "OrganizationDomain");
}
}

View File

@@ -1,36 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class ProviderAddProviderTypeBillingPhone : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "BillingPhone",
table: "Provider",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<byte>(
name: "Type",
table: "Provider",
type: "tinyint unsigned",
nullable: false,
defaultValue: (byte)0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BillingPhone",
table: "Provider");
migrationBuilder.DropColumn(
name: "Type",
table: "Provider");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,282 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class SecretsManager : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UseSecretsManager",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "Project",
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"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DeletedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Project", x => x.Id);
table.ForeignKey(
name: "FK_Project_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Secret",
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"),
Key = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Note = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DeletedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Secret", x => x.Id);
table.ForeignKey(
name: "FK_Secret_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceAccount",
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"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceAccount", x => x.Id);
table.ForeignKey(
name: "FK_ServiceAccount_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ProjectSecret",
columns: table => new
{
ProjectsId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
SecretsId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectSecret", x => new { x.ProjectsId, x.SecretsId });
table.ForeignKey(
name: "FK_ProjectSecret_Project_ProjectsId",
column: x => x.ProjectsId,
principalTable: "Project",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectSecret_Secret_SecretsId",
column: x => x.SecretsId,
principalTable: "Secret",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AccessPolicy",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GroupId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
GrantedProjectId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
GrantedServiceAccountId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ServiceAccountId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Read = table.Column<bool>(type: "tinyint(1)", nullable: false),
Write = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Discriminator = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AccessPolicy", x => x.Id);
table.ForeignKey(
name: "FK_AccessPolicy_Group_GroupId",
column: x => x.GroupId,
principalTable: "Group",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AccessPolicy_OrganizationUser_OrganizationUserId",
column: x => x.OrganizationUserId,
principalTable: "OrganizationUser",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AccessPolicy_Project_GrantedProjectId",
column: x => x.GrantedProjectId,
principalTable: "Project",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AccessPolicy_ServiceAccount_GrantedServiceAccountId",
column: x => x.GrantedServiceAccountId,
principalTable: "ServiceAccount",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AccessPolicy_ServiceAccount_ServiceAccountId",
column: x => x.ServiceAccountId,
principalTable: "ServiceAccount",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ApiKey",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceAccountId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientSecret = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Scope = table.Column<string>(type: "varchar(4000)", maxLength: 4000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EncryptedPayload = table.Column<string>(type: "varchar(4000)", maxLength: 4000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExpireAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiKey", x => x.Id);
table.ForeignKey(
name: "FK_ApiKey_ServiceAccount_ServiceAccountId",
column: x => x.ServiceAccountId,
principalTable: "ServiceAccount",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_GrantedProjectId",
table: "AccessPolicy",
column: "GrantedProjectId");
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_GrantedServiceAccountId",
table: "AccessPolicy",
column: "GrantedServiceAccountId");
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_GroupId",
table: "AccessPolicy",
column: "GroupId");
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_OrganizationUserId",
table: "AccessPolicy",
column: "OrganizationUserId");
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_ServiceAccountId",
table: "AccessPolicy",
column: "ServiceAccountId");
migrationBuilder.CreateIndex(
name: "IX_ApiKey_ServiceAccountId",
table: "ApiKey",
column: "ServiceAccountId");
migrationBuilder.CreateIndex(
name: "IX_Project_DeletedDate",
table: "Project",
column: "DeletedDate");
migrationBuilder.CreateIndex(
name: "IX_Project_OrganizationId",
table: "Project",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_ProjectSecret_SecretsId",
table: "ProjectSecret",
column: "SecretsId");
migrationBuilder.CreateIndex(
name: "IX_Secret_DeletedDate",
table: "Secret",
column: "DeletedDate");
migrationBuilder.CreateIndex(
name: "IX_Secret_OrganizationId",
table: "Secret",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_ServiceAccount_OrganizationId",
table: "ServiceAccount",
column: "OrganizationId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AccessPolicy");
migrationBuilder.DropTable(
name: "ApiKey");
migrationBuilder.DropTable(
name: "ProjectSecret");
migrationBuilder.DropTable(
name: "ServiceAccount");
migrationBuilder.DropTable(
name: "Project");
migrationBuilder.DropTable(
name: "Secret");
migrationBuilder.DropColumn(
name: "UseSecretsManager",
table: "Organization");
}
}

View File

@@ -1,76 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class FixNavigationProperties : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CollectionUsers_User_UserId",
table: "CollectionUsers");
migrationBuilder.DropForeignKey(
name: "FK_GroupUser_User_UserId",
table: "GroupUser");
migrationBuilder.DropIndex(
name: "IX_GroupUser_UserId",
table: "GroupUser");
migrationBuilder.DropIndex(
name: "IX_CollectionUsers_UserId",
table: "CollectionUsers");
migrationBuilder.DropColumn(
name: "UserId",
table: "GroupUser");
migrationBuilder.DropColumn(
name: "UserId",
table: "CollectionUsers");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "UserId",
table: "GroupUser",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "UserId",
table: "CollectionUsers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_GroupUser_UserId",
table: "GroupUser",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_CollectionUsers_UserId",
table: "CollectionUsers",
column: "UserId");
migrationBuilder.AddForeignKey(
name: "FK_CollectionUsers_User_UserId",
table: "CollectionUsers",
column: "UserId",
principalTable: "User",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_GroupUser_User_UserId",
table: "GroupUser",
column: "UserId",
principalTable: "User",
principalColumn: "Id");
}
}

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class RemoveDeviceUnknownVerification : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UnknownDeviceVerificationEnabled",
table: "User");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "UnknownDeviceVerificationEnabled",
table: "User",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class OrganizationStatus : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<byte>(
name: "Status",
table: "Organization",
type: "tinyint unsigned",
nullable: false,
defaultValue: (byte)1);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Status",
table: "Organization");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class KDFOptions : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "KdfMemory",
table: "User",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "KdfParallelism",
table: "User",
type: "int",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "KdfMemory",
table: "User");
migrationBuilder.DropColumn(
name: "KdfParallelism",
table: "User");
}
}

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class SecretsManagerOrganizationUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "AccessSecretsManager",
table: "OrganizationUser",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AccessSecretsManager",
table: "OrganizationUser");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,54 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class LastUserDates : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "LastEmailChangeDate",
table: "User",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastKdfChangeDate",
table: "User",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastKeyRotationDate",
table: "User",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastPasswordChangeDate",
table: "User",
type: "datetime(6)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LastEmailChangeDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastKdfChangeDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastKeyRotationDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastPasswordChangeDate",
table: "User");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class CipherKeyUpdate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Key",
table: "Cipher",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Key",
table: "Cipher");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class SecretsManagerEvent : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "SecretId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ServiceAccountId",
table: "Event",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SecretId",
table: "Event");
migrationBuilder.DropColumn(
name: "ServiceAccountId",
table: "Event");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class EFUpdate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RequestFingerprint",
table: "AuthRequest");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "RequestFingerprint",
table: "AuthRequest",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class AddKeysToDevice : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "EncryptedPrivateKey",
table: "Device",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "EncryptedPublicKey",
table: "Device",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "EncryptedUserKey",
table: "Device",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EncryptedPrivateKey",
table: "Device");
migrationBuilder.DropColumn(
name: "EncryptedPublicKey",
table: "Device");
migrationBuilder.DropColumn(
name: "EncryptedUserKey",
table: "Device");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class ClientSecretHash : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientSecret",
table: "ApiKey");
migrationBuilder.AddColumn<string>(
name: "ClientSecretHash",
table: "ApiKey",
type: "varchar(128)",
maxLength: 128,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientSecretHash",
table: "ApiKey");
migrationBuilder.AddColumn<string>(
name: "ClientSecret",
table: "ApiKey",
type: "varchar(30)",
maxLength: 30,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
}

View File

@@ -1,66 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class AddSecretsManagerBillingFieldToOrganization : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "MaxAutoscaleSmSeats",
table: "Organization",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "MaxAutoscaleSmServiceAccounts",
table: "Organization",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SmSeats",
table: "Organization",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SmServiceAccounts",
table: "Organization",
type: "int",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "UsePasswordManager",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MaxAutoscaleSmSeats",
table: "Organization");
migrationBuilder.DropColumn(
name: "MaxAutoscaleSmServiceAccounts",
table: "Organization");
migrationBuilder.DropColumn(
name: "SmSeats",
table: "Organization");
migrationBuilder.DropColumn(
name: "SmServiceAccounts",
table: "Organization");
migrationBuilder.DropColumn(
name: "UsePasswordManager",
table: "Organization");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class TdeAdminApproval : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "OrganizationId",
table: "AuthRequest",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_AuthRequest_OrganizationId",
table: "AuthRequest",
column: "OrganizationId");
migrationBuilder.AddForeignKey(
name: "FK_AuthRequest_Organization_OrganizationId",
table: "AuthRequest",
column: "OrganizationId",
principalTable: "Organization",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AuthRequest_Organization_OrganizationId",
table: "AuthRequest");
migrationBuilder.DropIndex(
name: "IX_AuthRequest_OrganizationId",
table: "AuthRequest");
migrationBuilder.DropColumn(
name: "OrganizationId",
table: "AuthRequest");
}
}

View File

@@ -1,28 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class SecretsManagerBetaColumn : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "SecretsManagerBeta",
table: "Organization",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SecretsManagerBeta",
table: "Organization");
}
}

View File

@@ -1,63 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AccessPolicy_Group_GroupId",
table: "AccessPolicy");
migrationBuilder.DropForeignKey(
name: "FK_AccessPolicy_Project_GrantedProjectId",
table: "AccessPolicy");
migrationBuilder.AddForeignKey(
name: "FK_AccessPolicy_Group_GroupId",
table: "AccessPolicy",
column: "GroupId",
principalTable: "Group",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AccessPolicy_Project_GrantedProjectId",
table: "AccessPolicy",
column: "GrantedProjectId",
principalTable: "Project",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AccessPolicy_Group_GroupId",
table: "AccessPolicy");
migrationBuilder.DropForeignKey(
name: "FK_AccessPolicy_Project_GrantedProjectId",
table: "AccessPolicy");
migrationBuilder.AddForeignKey(
name: "FK_AccessPolicy_Group_GroupId",
table: "AccessPolicy",
column: "GroupId",
principalTable: "Group",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_AccessPolicy_Project_GrantedProjectId",
table: "AccessPolicy",
column: "GrantedProjectId",
principalTable: "Project",
principalColumn: "Id");
}
}

Some files were not shown because too many files have changed in this diff Show More