Skip to content

Commit

Permalink
comment clean up; formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ike-kottlowski committed Sep 13, 2024
1 parent ecaf974 commit b7414e1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ BEGIN
AND T.RowNum <= (@UserBatchNum + 1) * @UserBatchSize;

SET @UserBatchNum = @UserBatchNum + 1;

-- Optional: Print progress
-- PRINT 'Processed User batch ' + CAST(@BatchNum AS VARCHAR(10)) + ' of ' + CAST((@TotalRows - 1) / @BatchSize + 1 AS VARCHAR(10));
END

-- Clean up
Expand Down Expand Up @@ -78,10 +75,7 @@ BEGIN
AND T.RowNum <= (@OrganizationBatchNum + 1) * @OrganizationBatchSize;

SET @OrganizationBatchNum = @OrganizationBatchNum + 1;

-- Optional: Print progress
-- PRINT 'Processed Organization batch ' + CAST(@BatchNum AS VARCHAR(10)) + ' of ' + CAST((@TotalRows - 1) / @BatchSize + 1 AS VARCHAR(10));
END

-- Clean up
DROP TABLE #TempOrganizationIDs;
DROP TABLE #TempOrganizationIDs;
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ protected override void Down(MigrationBuilder migrationBuilder)
throw new Exception("Irreversible migration");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ set
("TwoFactorProviders"::jsonb -> '6' -> 'MetaData' -> 'IKey'))
where
"TwoFactorProviders" like '%"6":%'
and jsonb_typeof("TwoFactorProviders"::jsonb) = 'object';
and jsonb_typeof("TwoFactorProviders"::jsonb) = 'object';

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Bit.PostgresMigrations.Migrations;

public partial class GenerateDuoSDKVersion4TwoFactorMetadata : Migration
{
private const string _scriptLocation =
private const string _scriptLocation =
"PostgresMigrations.HelperScripts.2024-09-05_00_SyncDuoVersionFourMetadataToVersionTwo.psql";

protected override void Up(MigrationBuilder migrationBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SET TwoFactorProviders = json_set(
json_extract("User".TwoFactorProviders, '$."2".MetaData.IKey')
)
WHERE TwoFactorProviders LIKE '%"2":%'
AND JSON_VALID(TwoFactorProviders) = 1;
AND JSON_VALID(TwoFactorProviders) = 1;

-- Update Organizations
UPDATE "Organization"
Expand All @@ -31,4 +31,5 @@ SET TwoFactorProviders = json_set(
json_extract("Organization".TwoFactorProviders, '$."6".MetaData.IKey')
)
WHERE TwoFactorProviders LIKE '%"6":%'
AND JSON_VALID(TwoFactorProviders) = 1;
AND JSON_VALID(TwoFactorProviders) = 1;

0 comments on commit b7414e1

Please sign in to comment.