Skip to content

Commit bbb55ef

Browse files
authored
Limit migrations to only once (bitwarden#1996)
1 parent c54c39b commit bbb55ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

util/Migrator/DbScripts/2022-03-01_00_AddApiKeysTable.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ BEGIN
201201
0 AS [Type], -- 0 represents 'Default' type
202202
[RevisionDate]
203203
FROM [dbo].[Organization]
204+
WHERE NOT EXISTS(SELECT [Id] FROM [dbo].[OrganizationApiKey] [ApiKey] WHERE [ApiKey].[OrganizationId] = [OrganizationId] AND [ApiKey].[Type] = 0)
204205

205206
PRINT N'Dropping old column'
206207
ALTER TABLE

0 commit comments

Comments
 (0)