1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-10 20:07:56 +01:00

[AC-1360] Added EF migration scripts

This commit is contained in:
Rui Tome 2023-08-03 21:14:38 +01:00
parent 4b47d25755
commit a4ea5c4dca
No known key found for this signature in database
GPG Key ID: 526239D96A8EC066
12 changed files with 6777 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
using Bit.Core.Utilities;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class PopulateResellerNames : Migration
{
private const string _scriptLocation = "MySqlMigrations.HelperScripts.2023-08-03_00_PopulateResellerNames.sql";
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
throw new Exception("Irreversible migration");
}
}

View File

@ -29,6 +29,6 @@
<EmbeddedResource Include="HelperScripts\2021-10-21_00_SetMaxAutoscaleSeatCount.sql" />
<EmbeddedResource Include="HelperScripts\2022-03-01_00_Up_MigrateOrganizationApiKeys.sql" />
<EmbeddedResource Include="HelperScripts\2022-03-01_00_Down_MigrateOrganizationApiKeys.sql" />
<EmbeddedResource Include="Scripts\2023-08-03_00_PopulateResellerNames.sql" />
<EmbeddedResource Include="HelperScripts\2023-08-03_00_PopulateResellerNames.sql" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
using Bit.Core.Utilities;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class PopulateResellerNames : Migration
{
private const string _scriptLocation = "PostgresMigrations.HelperScripts.2023-08-03_00_PopulateResellerNames.psql";
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
throw new Exception("Irreversible migration");
}
}

View File

@ -24,6 +24,6 @@
<EmbeddedResource Include="HelperScripts\2021-10-21_00_SetMaxAutoscaleSeatCount.psql" />
<EmbeddedResource Include="HelperScripts\2022-03-01_00_Up_MigrateOrganizationApiKeys.psql" />
<EmbeddedResource Include="HelperScripts\2022-03-01_00_Down_MigrateOrganizationApiKeys.psql" />
<EmbeddedResource Include="Scripts\2023-08-03_00_PopulateResellerNames.sql" />
<EmbeddedResource Include="HelperScripts\2023-08-03_00_PopulateResellerNames.psql" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
using Bit.Core.Utilities;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.SqliteMigrations.Migrations;
/// <inheritdoc />
public partial class PopulateResellerNames : Migration
{
private const string _scriptLocation = "SqliteMigrations.HelperScripts.2023-08-03_00_PopulateResellerNames.sql";
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(CoreHelpers.GetEmbeddedResourceContentsAsync(_scriptLocation));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
throw new Exception("Irreversible migration");
}
}

View File

@ -23,7 +23,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scripts\2023-08-03_00_PopulateResellerNames.sql" />
<EmbeddedResource Include="HelperScripts\2023-08-03_00_PopulateResellerNames.sql" />
</ItemGroup>
</Project>