-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add github login * add github login * add migrate and build at the same time
- Loading branch information
Showing
21 changed files
with
7,389 additions
and
1,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { env } from "@/env"; | ||
import type { Config } from "drizzle-kit"; | ||
|
||
export default { | ||
schema: "./src/db/schema.ts", | ||
out: "./drizzle", | ||
driver: "turso", | ||
dbCredentials: { | ||
url: env.DATABASE_URL, | ||
authToken: env.DATABASE_AUTH_TOKEN, | ||
}, | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE `user` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text, | ||
`picture` text, | ||
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `user_auth` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`user_id` text, | ||
`provider` text, | ||
`provider_id` text, | ||
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `user_session` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`user_id` text NOT NULL, | ||
`auth_id` text, | ||
`user_agent` text, | ||
`expires_at` blob NOT NULL, | ||
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
--> statement-breakpoint | ||
CREATE UNIQUE INDEX `user_auth_provider_provider_id_unique` ON `user_auth` (`provider`,`provider_id`);--> statement-breakpoint | ||
CREATE INDEX `user_session_expire_idx` ON `user_session` (`expires_at`);--> statement-breakpoint | ||
CREATE INDEX `user_session_auth_id_idx` ON `user_session` (`auth_id`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"id": "842060cb-8a3f-4721-aeb8-909365440ca3", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"tables": { | ||
"user": { | ||
"name": "user", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"picture": { | ||
"name": "picture", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"user_auth": { | ||
"name": "user_auth", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"provider": { | ||
"name": "provider", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"provider_id": { | ||
"name": "provider_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
} | ||
}, | ||
"indexes": { | ||
"user_auth_provider_provider_id_unique": { | ||
"name": "user_auth_provider_provider_id_unique", | ||
"columns": [ | ||
"provider", | ||
"provider_id" | ||
], | ||
"isUnique": true | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"user_session": { | ||
"name": "user_session", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"auth_id": { | ||
"name": "auth_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"user_agent": { | ||
"name": "user_agent", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"expires_at": { | ||
"name": "expires_at", | ||
"type": "blob", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": { | ||
"user_session_expire_idx": { | ||
"name": "user_session_expire_idx", | ||
"columns": [ | ||
"expires_at" | ||
], | ||
"isUnique": false | ||
}, | ||
"user_session_auth_id_idx": { | ||
"name": "user_session_auth_id_idx", | ||
"columns": [ | ||
"auth_id" | ||
], | ||
"isUnique": false | ||
} | ||
}, | ||
"foreignKeys": { | ||
"user_session_user_id_user_id_fk": { | ||
"name": "user_session_user_id_user_id_fk", | ||
"tableFrom": "user_session", | ||
"tableTo": "user", | ||
"columnsFrom": [ | ||
"user_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"entries": [ | ||
{ | ||
"idx": 0, | ||
"version": "5", | ||
"when": 1710049140295, | ||
"tag": "0000_solid_scream", | ||
"breakpoints": true | ||
} | ||
] | ||
} |
Oops, something went wrong.