-
Notifications
You must be signed in to change notification settings - Fork 17
feat: [breaking] cmueats gets a real database that can store more than 7 days worth of times, and also stores overwrites #195
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
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
e9ff386
feat: capital grains override
cirex-web 1e4c2d0
chore: remove console.log
cirex-web 9ad006d
fix: fix existing tests
cirex-web 54fd9b2
tests: add tests for overwrites
cirex-web 56b33b7
fix: notify when response date header becomes unparseable
cirex-web ee2dafb
Merge branch 'staging' of https://github.com/ScottyLabs/dining-api in…
cirex-web e2e18ec
refactor: rework the entire parsing algorithm to better accomodate ti…
cirex-web b1ea9a9
chore: update time slot overwrite description
cirex-web c196e80
Merge branch 'staging' into feat/time-overwrites
cirex-web 4821b33
chore: fix cheerio element typechecking
cirex-web 078a5eb
chore: add luxon types
cirex-web b39a02c
feat: complete database integration with overwriting any field (exclu…
cirex-web 771a107
chore: remove time overwrites file
cirex-web ca24b72
tests: fix a good number of tests
cirex-web c8d7722
style: add empty openapi endpoint and pretty-print all json
cirex-web 7f290e2
test: fix all tests
cirex-web 10d12dd
fix: typecheck
cirex-web eac9ca6
chore: move from jest to vitest
cirex-web 2d06aad
fix: tests
cirex-web fd00731
tests: add 2 mock db tests
cirex-web ac79f07
fix: give more startup time for tests
cirex-web 2507234
test: run all tests
cirex-web cc1c3f6
tests: test on dst times and specials
cirex-web 1bf7b1b
fix: make the 'today' param required for scrape result
cirex-web c5d45c9
test: parallel tests
cirex-web 07ad8c4
test: run all tests
cirex-web f8d6878
test: make tests more readable
cirex-web 687ed6f
test: add a few more tests
cirex-web e93638d
chore: rename variable
cirex-web 4ecf5cb
chore: bundle writes into single transaction and add coverage reporting
cirex-web 7f6d7ef
chore: uncomment reload function
cirex-web 079587d
chore: upd readme
cirex-web 4ac144b
Initial plan
Copilot 76891b8
Refactor timestamps in database.test.ts to use timeToUnixTimestamp fu…
Copilot fdaa26e
chore: upd readme
cirex-web 9f7901d
chore: add column names to some columns in the schema
cirex-web 85bafd1
chore: remove redundant paren
cirex-web b9d747c
Merge pull request #213 from ScottyLabs/copilot/sub-pr-195-again
cirex-web 8be7e44
test: add two more tests
cirex-web d9b38ef
chore: add additional today param check
cirex-web a40b010
fix: date timezone thing for tests
cirex-web 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,57 @@ | ||
| CREATE TYPE "public"."specialType" AS ENUM('special', 'soup');--> statement-breakpoint | ||
| CREATE TABLE "concept_id_to_internal_id" ( | ||
| "internal_id" text NOT NULL, | ||
| "external_id" text PRIMARY KEY NOT NULL, | ||
| CONSTRAINT "concept_id_to_internal_id_external_id_unique" UNIQUE("external_id") | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "location_data" ( | ||
| "id" text PRIMARY KEY NOT NULL, | ||
| "name" text, | ||
| "short_description" text, | ||
| "description" text NOT NULL, | ||
| "url" text NOT NULL, | ||
| "menu" text, | ||
| "location" text NOT NULL, | ||
| "coordinate_lat" numeric, | ||
| "coordinate_lng" numeric, | ||
| "acceptsOnlineOrders" boolean NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "specials" ( | ||
| "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "specials_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), | ||
| "location_id" text NOT NULL, | ||
| "name" text NOT NULL, | ||
| "description" text NOT NULL, | ||
| "date" date NOT NULL, | ||
| "type" "specialType" NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "time_overwrites_table" ( | ||
| "location_id" text NOT NULL, | ||
| "date" date NOT NULL, | ||
| "time_string" text NOT NULL, | ||
| CONSTRAINT "time_overwrites_table_location_id_date_pk" PRIMARY KEY("location_id","date") | ||
| ); | ||
| --> statement-breakpoint | ||
| CREATE TABLE "location_times" ( | ||
| "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "location_times_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), | ||
| "location_id" text NOT NULL, | ||
| "date" date NOT NULL, | ||
| "start_time" integer NOT NULL, | ||
| "end_time" integer NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "overwrites_table" RENAME COLUMN "concept_id" TO "location_id";--> statement-breakpoint | ||
|
|
||
| -- Manual | ||
| ALTER TABLE "overwrites_table" ALTER COLUMN "location_id" TYPE TEXT, ALTER COLUMN "location_id" SET NOT NULL; --> statement-breakpoint | ||
| -- Manual | ||
|
|
||
| ALTER TABLE "concept_id_to_internal_id" ADD CONSTRAINT "concept_id_to_internal_id_internal_id_location_data_id_fk" FOREIGN KEY ("internal_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
| ALTER TABLE "specials" ADD CONSTRAINT "specials_location_id_location_data_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
| ALTER TABLE "time_overwrites_table" ADD CONSTRAINT "time_overwrites_table_location_id_location_data_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
| ALTER TABLE "location_times" ADD CONSTRAINT "location_times_location_id_location_data_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
| CREATE INDEX "date_lookup" ON "location_times" USING btree ("location_id","date");--> statement-breakpoint | ||
| ALTER TABLE "overwrites_table" ADD CONSTRAINT "overwrites_table_location_id_location_data_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
| ALTER TABLE "overwrites_table" DROP COLUMN "times"; |
This file contains hidden or 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,3 @@ | ||
| ALTER TABLE "location_data" RENAME COLUMN "acceptsOnlineOrders" TO "accepts_online_orders";--> statement-breakpoint | ||
| ALTER TABLE "overwrites_table" RENAME COLUMN "coordinateLat" TO "coordinate_lat";--> statement-breakpoint | ||
| ALTER TABLE "overwrites_table" RENAME COLUMN "coordinateLng" TO "coordinate_lng"; |
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.
why is this file named like this lol
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.
drizzle auto-names the migration files lol