-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better auth and cors integrations
- Loading branch information
Showing
14 changed files
with
458 additions
and
4 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
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
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,49 @@ | ||
CREATE TABLE IF NOT EXISTS "account" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"accountId" text NOT NULL, | ||
"providerId" text NOT NULL, | ||
"userId" text NOT NULL, | ||
"accessToken" text, | ||
"refreshToken" text, | ||
"idToken" text, | ||
"expiresAt" timestamp, | ||
"password" text | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "session" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"expiresAt" timestamp NOT NULL, | ||
"ipAddress" text, | ||
"userAgent" text, | ||
"userId" text NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "user" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"name" text NOT NULL, | ||
"email" text NOT NULL, | ||
"emailVerified" boolean NOT NULL, | ||
"image" text, | ||
"createdAt" timestamp NOT NULL, | ||
"updatedAt" timestamp NOT NULL, | ||
CONSTRAINT "user_email_unique" UNIQUE("email") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "verification" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"identifier" text NOT NULL, | ||
"value" text NOT NULL, | ||
"expiresAt" timestamp NOT NULL | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "account" ADD CONSTRAINT "account_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "session" ADD CONSTRAINT "session_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
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,286 @@ | ||
{ | ||
"id": "56ce94aa-a168-4104-ba96-f7e2973fad5c", | ||
"prevId": "8164177c-dd44-4165-b734-fc0acaa9171b", | ||
"version": "7", | ||
"dialect": "postgresql", | ||
"tables": { | ||
"public.animals": { | ||
"name": "animals", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"science_name": { | ||
"name": "science_name", | ||
"type": "varchar(512)", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": { | ||
"name_idx": { | ||
"name": "name_idx", | ||
"columns": [ | ||
{ | ||
"expression": "name", | ||
"isExpression": false, | ||
"asc": true, | ||
"nulls": "last" | ||
} | ||
], | ||
"isUnique": true, | ||
"concurrently": false, | ||
"method": "btree", | ||
"with": {} | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"public.account": { | ||
"name": "account", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"accountId": { | ||
"name": "accountId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"providerId": { | ||
"name": "providerId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"userId": { | ||
"name": "userId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"accessToken": { | ||
"name": "accessToken", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"refreshToken": { | ||
"name": "refreshToken", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"idToken": { | ||
"name": "idToken", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"expiresAt": { | ||
"name": "expiresAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"password": { | ||
"name": "password", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"account_userId_user_id_fk": { | ||
"name": "account_userId_user_id_fk", | ||
"tableFrom": "account", | ||
"tableTo": "user", | ||
"columnsFrom": [ | ||
"userId" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"public.session": { | ||
"name": "session", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"expiresAt": { | ||
"name": "expiresAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"ipAddress": { | ||
"name": "ipAddress", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"userAgent": { | ||
"name": "userAgent", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"userId": { | ||
"name": "userId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"session_userId_user_id_fk": { | ||
"name": "session_userId_user_id_fk", | ||
"tableFrom": "session", | ||
"tableTo": "user", | ||
"columnsFrom": [ | ||
"userId" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"public.user": { | ||
"name": "user", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"email": { | ||
"name": "email", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"emailVerified": { | ||
"name": "emailVerified", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"image": { | ||
"name": "image", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"createdAt": { | ||
"name": "createdAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"updatedAt": { | ||
"name": "updatedAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": { | ||
"user_email_unique": { | ||
"name": "user_email_unique", | ||
"nullsNotDistinct": false, | ||
"columns": [ | ||
"email" | ||
] | ||
} | ||
} | ||
}, | ||
"public.verification": { | ||
"name": "verification", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"identifier": { | ||
"name": "identifier", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"value": { | ||
"name": "value", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"expiresAt": { | ||
"name": "expiresAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"schemas": {}, | ||
"sequences": {}, | ||
"_meta": { | ||
"columns": {}, | ||
"schemas": {}, | ||
"tables": {} | ||
} | ||
} |
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
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
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
Oops, something went wrong.