1
0
mirror of https://github.com/bitwarden/server synced 2025-12-26 13:13:24 +00:00

sql tuning and migrations

This commit is contained in:
Kyle Spearrin
2017-04-13 13:16:15 -04:00
parent bf18a5905d
commit 5a24b6624d
10 changed files with 83 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
-- Step 1, Run each statement individually
insert into folder
select Id, UserId, JSON_VALUE(Data,'$.Name') AS [Name], CreationDate, RevisionDate
from cipher
@@ -12,3 +14,20 @@ insert into favorite
select UserId, [Id]
from cipher
where Favorite = 1
-- Step 2, drop each column
alter table cipher drop constraint [FK_Cipher_Folder]
go
alter table cipher drop column FolderId
go
alter table cipher drop column Favorite
go
-- Step 3, delete old folder ciphers
delete from cipher where [type] = 0