Skip to content

Commit 84bcecb

Browse files
docs(database): add mssql indexes in docs, fix typos (#925)
* added mssql indexes in docs, fixed typo * docs: fix typo in www/docs/schemas/mssql.md Co-authored-by: Balázs Orbán <[email protected]>
1 parent 5060bd7 commit 84bcecb

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

www/docs/schemas/mssql.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,31 @@ CREATE TABLE verification_requests
5858
created_at datetime NOT NULL DEFAULT getdate(),
5959
updated_at datetime NOT NULL DEFAULT getdate()
6060
);
61-
```
6261

63-
:::warning
64-
The above schema is incomplete, it does not include indexes.
62+
CREATE UNIQUE INDEX compound_id
63+
ON accounts(compound_id);
64+
65+
CREATE INDEX provider_account_id
66+
ON accounts(provider_account_id);
67+
68+
CREATE INDEX provider_id
69+
ON accounts(provider_id);
70+
71+
CREATE INDEX user_id
72+
ON accounts(user_id);
73+
74+
CREATE UNIQUE INDEX session_token
75+
ON sessions(session_token);
6576

66-
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.
67-
:::
77+
CREATE UNIQUE INDEX access_token
78+
ON sessions(access_token);
79+
80+
CREATE UNIQUE INDEX email
81+
ON users(email);
82+
83+
CREATE UNIQUE INDEX token
84+
ON verification_requests(token);
85+
```
86+
87+
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.
88+
:::

0 commit comments

Comments
 (0)