1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-27 14:24:56 -05:00

move script back and move userview update up

This commit is contained in:
Kyle Spearrin 2018-07-19 16:22:30 -04:00
parent 266fc579f2
commit b0aef93597
4 changed files with 25 additions and 26 deletions

View File

@ -7,6 +7,30 @@ BEGIN
END
GO
IF NOT EXISTS (
SELECT * FROM sys.indexes WHERE [Name]='IX_User_Premium_PremiumExpirationDate_RenewalReminderDate'
AND object_id = OBJECT_ID('[dbo].[User]')
)
BEGIN
CREATE NONCLUSTERED INDEX [IX_User_Premium_PremiumExpirationDate_RenewalReminderDate]
ON [dbo].[User]([Premium] ASC, [PremiumExpirationDate] ASC, [RenewalReminderDate] ASC)
END
GO
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'UserView')
BEGIN
DROP VIEW [dbo].[UserView]
END
GO
CREATE VIEW [dbo].[UserView]
AS
SELECT
*
FROM
[dbo].[User]
GO
IF OBJECT_ID('[dbo].[User_Create]') IS NOT NULL
BEGIN
DROP PROCEDURE [dbo].[User_Create]
@ -471,17 +495,3 @@ BEGIN
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId
END
GO
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'UserView')
BEGIN
DROP VIEW [dbo].[UserView]
END
GO
CREATE VIEW [dbo].[UserView]
AS
SELECT
*
FROM
[dbo].[User]
GO

View File

@ -1,9 +0,0 @@
IF NOT EXISTS (
SELECT * FROM sys.indexes WHERE [Name]='IX_User_Premium_PremiumExpirationDate_RenewalReminderDate'
AND object_id = OBJECT_ID('[dbo].[User]')
)
BEGIN
CREATE NONCLUSTERED INDEX [IX_User_Premium_PremiumExpirationDate_RenewalReminderDate]
ON [dbo].[User]([Premium] ASC, [PremiumExpirationDate] ASC, [RenewalReminderDate] ASC)
END
GO

View File

@ -252,7 +252,7 @@ namespace Bit.Setup
.JournalToSqlTable("dbo", "Migration")
.WithScriptsAndCodeEmbeddedInAssembly(Assembly.GetExecutingAssembly(),
s => s.Contains($".DbScripts.") && !s.Contains(".Archive."))
.WithTransactionPerScript()
.WithTransaction()
.WithExecutionTimeout(new TimeSpan(0, 5, 0))
.LogToConsole()
.Build();

View File

@ -11,11 +11,9 @@
<None Remove="DbScripts\2018-04-02_00_Org2fa.sql" />
<None Remove="DbScripts\2018-04-24_00_CipherQueryTuning.sql" />
<None Remove="DbScripts\2018-06-11_00_WebVaultUpdates.sql" />
<None Remove="DbScripts\2018-07-19_00_UserPremiumIndex.sql" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DbScripts\2018-07-19_00_UserPremiumIndex.sql" />
<EmbeddedResource Include="DbScripts\2018-06-11_00_WebVaultUpdates.sql" />
<EmbeddedResource Include="DbScripts\2018-04-24_00_CipherQueryTuning.sql" />
<EmbeddedResource Include="DbScripts\2018-04-02_00_Org2fa.sql" />