Skip to content

Commit

Permalink
Docs: Fix SQL (#1699)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowOnPaper authored Sep 26, 2024
1 parent 0b31689 commit 46ebc6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/pages/database/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ User ID can be numeric (see [Define user ID type](/basics/users#define-user-id-t
```sql
CREATE TABLE user (
id VARCHAR(255) PRIMARY KEY
)
);

CREATE TABLE user_session (
id VARCHAR(255) PRIMARY KEY,
expires_at DATETIME NOT NULL,
user_id VARCHAR(255) NOT NULL REFERENCES user(id)
)
);
```

## Drivers
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/database/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ User ID can be numeric (see [Define user ID type](/basics/users#define-user-id-t
```sql
CREATE TABLE auth_user (
id TEXT PRIMARY KEY
)
);

CREATE TABLE user_session (
id TEXT PRIMARY KEY,
expires_at TIMESTAMPTZ NOT NULL,
user_id TEXT NOT NULL REFERENCES auth_user(id)
)
);
```

## Drivers
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/database/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ User ID can be numeric (see [Define user ID type](/basics/users#define-user-id-t
```sql
CREATE TABLE user (
id TEXT NOT NULL PRIMARY KEY
)
);

CREATE TABLE session (
id TEXT NOT NULL PRIMARY KEY,
expires_at INTEGER NOT NULL,
user_id TEXT NOT NULL,
FOREIGN KEY (user_id) REFERENCES user(id)
)
);
```

## Drivers
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/oauth/multiple-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ To support multiple OAuth sign-in methods, we can store the OAuth credentials in
Here's an example with SQLite:

```sql
CREATE TABLE oauth_account {
CREATE TABLE oauth_account (
provider_id TEXT NOT NULL,
provider_user_id TEXT NOT NULL,
user_id TEXT NOT NULL,
PRIMARY KEY (provider_id, provider_user_id),
FOREIGN KEY (user_id) REFERENCES user(id)
}
);
```

We can then remove the `github_id` column etc from the user table.
Expand Down

0 comments on commit 46ebc6a

Please sign in to comment.