Skip to content

docs: added mssql indexes in docs, fixed typo #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions www/docs/schemas/mssql.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,31 @@ CREATE TABLE verification_requests
created_at datetime NOT NULL DEFAULT getdate(),
updated_at datetime NOT NULL DEFAULT getdate()
);
```

:::warning
The above schema is incomplete, it does not include indexes.
CREATE UNIQUE INDEX compound_id
ON accounts(compound_id);

CREATE INDEX provider_account_id
ON accounts(provider_account_id);

CREATE INDEX provider_id
ON accounts(provider_id);

CREATE INDEX user_id
ON accounts(user_id);

CREATE UNIQUE INDEX session_token
ON sessions(session_token);

CREATE UNIQUE INDEX access_token
ON sessions(access_token);

CREATE UNIQUE INDEX email
ON users(email);

CREATE UNIQUE INDEX token
ON verification_requests(token);
```

When using NextAuth.js with SQL Server fir the first time, run NextAuth.js once against your database with `?syncronize=true` on the connection string and export the schema that is created.
When using NextAuth.js with SQL Server fir the first time, run NextAuth.js once against your database with `?synchronize=true` on the connection string and export the schema that is created.
:::