Files
archived-next-auth/test/docker/databases/mssql/setup.sql
Iain Collins f1ae26efb6 Add Dockerfile to run build inside a container
Adds commands to start/rebuild/stop a Docker image of a sample Next.js app that loads the latest build of NextAuth.js from the current directory.

* `npm run test:app:start`
* `npm run test:app:rebuild`
* `npm run test:app:stop`

It is intended for further development for automated testing.

### About the build process

* The Dockerfile uses a multi-stage build process to optimise build performance, but the nature of the process is slow.
* Build times vary depending on computer speed and internet connection.
* Inital build times are slow (it may take 10 minutes or more).
* Subsequent builds on the same computer should be faster (1 minute or less).
* To ensure the package.json is valid, modules required in the next-auth package.json file are re-downloaded* on every build.
* A Docker compose file is used to allow us to extend the test app to run it again multiple databases.

Subsequent updates may look to improve performance, but it's important checks like checking package.json is valid and running the build in isolation are performed.
2020-09-03 23:47:40 +01:00

30 lines
771 B
Transact-SQL

USE master;
/* did you tear down the container ? */
if not exists (select name
from sys.syslogins
where name = 'nextauth')
CREATE LOGIN nextauth
WITH PASSWORD = 'password',
CHECK_POLICY = OFF;
GO
/* did you tear down the container ? */
if not exists (select name
from sys.databases
where name = 'nextauth' )
CREATE database nextauth
GO
/* did you tear down the container ? */
if not exists(select [name]
from sys.sysusers
where name= 'nextauth')
CREATE USER nextauth
WITH DEFAULT_SCHEMA =[dbo];
GO
/*
* Adding user as sysadmin,
* So you can easily drop/create/re-create/alter the database
* You will need to login to 'master' to do that
*/
exec sp_addsrvrolemember @loginame = N'nextauth', @rolename = N'sysadmin'