Do your application database creation and destruction reproducibly. Include application logins in that.
New-PostgresApplicationDatabase.ps1
Set-PostgresTemplate1DefaultLocale.ps1
New-SqlServerApplicationDatabase.ps1
SYNOPSIS: Create a Postgres application database and roles for owner, application, and application_readonly
SYNTAX
New-PostgresApplicationDatabase.ps1 [[-databaseName] <String>]
[[-postgresHost] <String>] [[-adminUser] <String>] [[-databaseOwner] <String>] [[-appAccount] <String>]
[[-appAccountPassword] <String>] [[-readonlyAppAccount] <String>] [[-readonlyAppAccountPassword] <String>]
[[-template] <String>] [-template0] [[-encoding] <String>] [[-locale] <String>] [[-addUUID] <Boolean>]
[-addFunctionsForPSAndDropConnections] [-addPlv8] [-addTrigram] [-dryRun] [-help] [-helpAvailableLocales]
[-deleteDatabaseAndRoles] [<CommonParameters>]
DESCRIPTION
Create a Postgres application database and create roles for owner, application, and application_readonly.
- the owner role has no login. the user that runs this script will be assigned to that role
- the application and application_readonly roles will be login roles with password either specified by you
or generated by this script.
- If the passwords are generated by this script, they will be printed as the first
2 lines of output of this script.
- If the script scram_postgres_password.py exists in the path, the passwords will be scram encrypted.
- Optionally install common extensions UUID, plv8 and trigram
- Optionally create functions for view and drop database connections
SYNOPSIS : Update Postgres template1 (which is the default template used by Create Database) to your preferred Locale settings.
SYNTAX
Set-PostgresTemplate1DefaultLocale.ps1 [[-dbLocale] <Object>]
[[-postgresHost] <Object>] [[-adminUser] <String>] [[-dbEncoding] <Object>] [-createViewAndDropConnectionFunctions]
[-addPlv8] [-addTrigram] [-addUUID] [-dryRun] [<CommonParameters>]
SYNOPSIS
Create an MS SQL Server application database and roles for application and application_readonly,
and alter authorization to an applicationdatabaseowner account
SYNTAX
New-SqlServerApplicationDatabase.ps1 [-databaseName <String>]
[-serverInstance <String>]
[-ciLogin <String>] [-ciLoginPassword <String>]
[-appLogin <String>] [-appLoginIsDbOwner] [-appLoginPassword <String>]
[-appReadonlyLogin <String>] [-appReadonlyLoginPassword <String>]
[-dryRun] [-help] [-helpFull]
[-databaseOwner <String>] [-deleteDatabaseAndLogins] [<CommonParameters>]
New-SqlServerApplicationDatabase.ps1
[-bootstrap] [-uninstallBootstrap]
[-serverInstance <String>]
[-saLogin <String>] [-saLoginPassword <String>]
[-ciLogin <String>] [-ciLoginPassword <String>]
[-dryRun] [-help] [-helpFull]
[<CommonParameters>]
BOOTSTRAPPING
Run this script first with the -bootstrap parameter and an sa login to create the assets needed
to use the script on SQL Server.
DESCRIPTION
Create an MS SQL Server application database and roles for application and application_readonly,
and alter authorization to an applicationdatabaseowner account.
- the application and application_readonly roles will be login roles with password either
specified by you or generated by this script.
- If the passwords are generated by this script, they will be printed as the first 2 lines
of output of this script.