Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SM-222] [SM-357] Squash Secrets Manager migrations #2540

Merged
merged 8 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-unified/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ COPY util/MySqlMigrations/*.csproj ./util/MySqlMigrations/
COPY util/PostgresMigrations/*.csproj ./util/PostgresMigrations/
COPY util/SqliteMigrations/*.csproj ./util/SqliteMigrations/
COPY bitwarden_license/src/Commercial.Core/*.csproj ./bitwarden_license/src/Commercial.Core/
COPY bitwarden_license/src/Commercial.Infrastructure.EntityFramework/*.csproj ./bitwarden_license/src/Commercial.Infrastructure.EntityFramework/
COPY Directory.Build.props .

# Restore Admin project dependencies and tools
Expand Down Expand Up @@ -129,6 +130,7 @@ COPY util/PostgresMigrations/. ./util/PostgresMigrations/
COPY util/SqliteMigrations/. ./util/SqliteMigrations/
COPY util/EfShared/. ./util/EfShared/
COPY bitwarden_license/src/Commercial.Core/. ./bitwarden_license/src/Commercial.Core/
COPY bitwarden_license/src/Commercial.Infrastructure.EntityFramework/. ./bitwarden_license/src/Commercial.Infrastructure.EntityFramework/
COPY .git/. ./.git/

# Build Admin app
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<ItemGroup>
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
<ProjectReference Include="..\Core\Core.csproj" />
<ProjectReference Include="..\..\bitwarden_license\src\Commercial.Infrastructure.EntityFramework\Commercial.Infrastructure.EntityFramework.csproj" />
</ItemGroup>

<Choose>
<When Condition="!$(DefineConstants.Contains('OSS'))">
<ItemGroup>
<ProjectReference Include="..\..\bitwarden_license\src\Commercial.Core\Commercial.Core.csproj" />
<ProjectReference Include="..\..\bitwarden_license\src\Commercial.Infrastructure.EntityFramework\Commercial.Infrastructure.EntityFramework.csproj" />
</ItemGroup>
</When>
</Choose>
Expand Down
1 change: 0 additions & 1 deletion src/Sql/Sql.sqlproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<Build Include="dbo\Functions\UserCipherDetails.sql" />
<Build Include="dbo\Functions\UserCollectionDetails.sql" />
<Build Include="dbo\Stored Procedures\ApiKey\ApiKeyDetails_ReadById.sql" />
<Build Include="dbo\Stored Procedures\ApiKey\ApiKey_ReadById.sql" />
<Build Include="dbo\Stored Procedures\ApiKey\ApiKey_ReadByServiceAccountId.sql" />
<Build Include="dbo\Stored Procedures\ApiKey\ApiKey_Create.sql" />
<Build Include="dbo\Stored Procedures\AuthRequest_Create.sql" />
Expand Down
13 changes: 0 additions & 13 deletions src/Sql/dbo/Stored Procedures/ApiKey/ApiKey_ReadById.sql

This file was deleted.

14 changes: 14 additions & 0 deletions src/Sql/dbo/Stored Procedures/Organization_DeleteById.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ BEGIN
WHERE
[OrganizationId] = @Id

DELETE AK
FROM
[dbo].[ApiKey] AK
INNER JOIN
[dbo].[ServiceAccount] SA ON [AK].[ServiceAccountId] = [SA].[Id]
WHERE
[SA].[OrganizationId] = @Id

DELETE
FROM
[dbo].[ServiceAccount]
WHERE
[OrganizationId] = @Id

DELETE
FROM
[dbo].[Organization]
Expand Down
10 changes: 10 additions & 0 deletions src/Sql/dbo/Stored Procedures/User_DeleteById.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ BEGIN
WHERE
OU.[UserId] = @Id

-- Delete AccessPolicy
DELETE
AP
FROM
[dbo].[AccessPolicy] AP
INNER JOIN
[dbo].[OrganizationUser] OU ON OU.[Id] = AP.[OrganizationUserId]
WHERE
[UserId] = @Id

-- Delete organization users
DELETE
FROM
Expand Down
2 changes: 1 addition & 1 deletion src/Sql/dbo/Tables/ProjectSecret.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
);

GO
CREATE INDEX [IX_ProjectSecret_SecretsId] ON [ProjectSecret] ([SecretsId]);
CREATE NONCLUSTERED INDEX [IX_ProjectSecret_SecretsId] ON [ProjectSecret] ([SecretsId]);
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ SELECT
O.[Use2fa],
O.[UseApi],
O.[UseResetPassword],
O.[UseSecretsManager],
O.[SelfHost],
O.[UsersGetPremium],
O.[UseCustomPermissions],
O.[UseSecretsManager],
O.[Seats],
O.[MaxCollections],
O.[MaxStorageGb],
Expand Down
20 changes: 0 additions & 20 deletions util/Migrator/DbScripts/2022-07-20_00_CreateSecretTable.sql

This file was deleted.

20 changes: 0 additions & 20 deletions util/Migrator/DbScripts/2022-08-10_00_Project.sql

This file was deleted.

120 changes: 0 additions & 120 deletions util/Migrator/DbScripts/2022-09-19_00_ProjectSecret.sql

This file was deleted.

16 changes: 0 additions & 16 deletions util/Migrator/DbScripts/2022-09-26_00_SmServiceAccount.sql

This file was deleted.

43 changes: 0 additions & 43 deletions util/Migrator/DbScripts/2022-09-27_00_ApiKey.sql

This file was deleted.

Loading