USE [master]
GO
CREATE LOGIN [keycloak_server] WITH PASSWORD=N'keycloak_server', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [master]
GO
CREATE LOGIN [aerobase_server] WITH PASSWORD=N'aerobase_server', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
CREATE DATABASE [keycloak_server] CONTAINMENT = NONE;
CREATE DATABASE [unifiedpush_server] CONTAINMENT = NONE;
GO

USE [keycloak_server]
GO
ALTER SERVER ROLE [setupadmin] ADD MEMBER [keycloak_server]
ALTER SERVER ROLE [processadmin] ADD MEMBER [keycloak_server]
CREATE USER [keycloak_server] FOR LOGIN [keycloak_server]
ALTER ROLE [db_owner] ADD MEMBER [keycloak_server]
GO
USE [unifiedpush_server]
GO
ALTER SERVER ROLE [setupadmin] ADD MEMBER [aerobase_server]
ALTER SERVER ROLE [processadmin] ADD MEMBER [aerobase_server]
CREATE USER [aerobase_server] FOR LOGIN [aerobase_server]
ALTER ROLE [db_owner] ADD MEMBER [aerobase_server]
GO