1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
bitwarden-server/util/SqlUpdate/2017-07-28_00_Gateways.sql
2017-07-28 14:24:07 -04:00

56 lines
853 B
Transact-SQL

EXEC sp_rename 'dbo.User.StripeSubscriptionId', 'GatewaySubscriptionId', 'COLUMN';
GO
EXEC sp_rename 'dbo.User.StripeCustomerId', 'GatewayCustomerId', 'COLUMN';
GO
EXEC sp_rename 'dbo.Organization.StripeSubscriptionId', 'GatewaySubscriptionId', 'COLUMN';
GO
EXEC sp_rename 'dbo.Organization.StripeCustomerId', 'GatewayCustomerId', 'COLUMN';
GO
alter table [user] add [Gateway] TINYINT NULL
go
alter table [organization] add [Gateway] TINYINT NULL
go
update [user] set [Gateway] = 0 where GatewaySubscriptionId IS NOT NULL
go
update [organization] set [Gateway] = 0 where GatewaySubscriptionId IS NOT NULL
go
drop view [dbo].[OrganizationView]
go
CREATE VIEW [dbo].[OrganizationView]
AS
SELECT
*
FROM
[dbo].[Organization]
GO
drop view [dbo].[UserView]
go
CREATE VIEW [dbo].[UserView]
AS
SELECT
*
FROM
[dbo].[User]
GO