Skip to content

Commit

Permalink
docs(database): add mssql indexes in docs, fix typos (#925)
Browse files Browse the repository at this point in the history
* added mssql indexes in docs, fixed typo

* docs: fix typo in www/docs/schemas/mssql.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>
  • Loading branch information
vidz1979 and balazsorban44 committed Feb 1, 2021
1 parent 5060bd7 commit 84bcecb
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 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);

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.
:::
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 for the first time, run NextAuth.js once against your database with `?synchronize=true` on the connection string and export the schema that is created.
:::

0 comments on commit 84bcecb

Please sign in to comment.