-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #4
Open
macgeargear
wants to merge
6
commits into
main
Choose a base branch
from
dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev #4
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cd6c404
feat: clerk authentication
macgeargear 7c3bb8e
feat: setup drizzle orm
macgeargear c1e02d0
fix: navbar
macgeargear 69c4d6a
fix: chore
macgeargear 5017ba2
fix: stock screener request
macgeargear a8d70f6
Merge pull request #3 from macgeargear/feat/company-profile
macgeargear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { defineConfig } from "drizzle-kit"; | ||
|
||
export default defineConfig({ | ||
schema: "./src/lib/db/schema.ts", | ||
driver: "pg", | ||
out: "./drizzle/migrations", | ||
dbCredentials: { | ||
connectionString: process.env.DATABASE_URL, | ||
}, | ||
verbose: true, | ||
strict: true, | ||
}); |
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,20 @@ | ||
CREATE TABLE IF NOT EXISTS "stocks" ( | ||
"id" uuid PRIMARY KEY NOT NULL, | ||
"name" text NOT NULL, | ||
"symbol" varchar(10) NOT NULL, | ||
"is_favorite" boolean NOT NULL, | ||
"user_id" uuid NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "users" ( | ||
"id" uuid PRIMARY KEY NOT NULL, | ||
"name" text NOT NULL, | ||
"email" text NOT NULL, | ||
"created_at" timestamp with time zone NOT NULL | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "stocks" ADD CONSTRAINT "stocks_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("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,103 @@ | ||
{ | ||
"id": "5016332f-c140-44c5-99c0-5190fc6f61b2", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"version": "5", | ||
"dialect": "pg", | ||
"tables": { | ||
"stocks": { | ||
"name": "stocks", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "uuid", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"symbol": { | ||
"name": "symbol", | ||
"type": "varchar(10)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"is_favorite": { | ||
"name": "is_favorite", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "uuid", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"stocks_user_id_users_id_fk": { | ||
"name": "stocks_user_id_users_id_fk", | ||
"tableFrom": "stocks", | ||
"tableTo": "users", | ||
"columnsFrom": [ | ||
"user_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"users": { | ||
"name": "users", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "uuid", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"email": { | ||
"name": "email", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"schemas": {}, | ||
"_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "pg", | ||
"entries": [ | ||
{ | ||
"idx": 0, | ||
"version": "5", | ||
"when": 1714141219080, | ||
"tag": "0000_faulty_wong", | ||
"breakpoints": true | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exception handling for the foreign key constraint addition is minimal. Consider expanding it to handle other potential exceptions such as
undefined_table
orundefined_column
.