Closed frankcollins3 closed 1 year ago
the issue can be more clearly seen here: fill_cont=# INSERT INTO data (id, google_id, date, progress, weekday, status, users_id) fill_cont-# VALUES (9, 'no google-id', '2023-7-01', 0, 'Saturday', '{}', 3); ERROR: insert or update on table "data" violates foreign key constraint "data_id_fkey" DETAIL: Key (id)=(9) is not present in table "users". fill_cont=#
compiler && db is expecting the link to be between data.users_id and users.id but it is set up to be: data.id === users.id (which we don't want)
/prisma/prisma.schema model data { id Int @id @default(autoincrement()) users users @relation(fields: [id], references: [id]) google_id String? date String? progress Int weekday String? status String[] users_id Int }
model users { id Int @id @default(autoincrement()) google_id String? icon String? username String? email String? password String? age Int? settings settings[] data data[] }
users users @relation(fields: [id], references: [id])
parcel > webpack for now [2:12pm]
attempting to do: nothing, installed webpack. now intending to make database tables worked as they did before.
error: data. has been uploading
proposed approach: something wrong obv. might restart tables
the big problem is everything this functionality is trying to do has been providing daily data with which to work.
GraphQL query hardcoding a 9 which is the next ID also confirmed by psql shell isnt working. this query has been working
actual psql shell data from the app. id | google_id | date | progress | weekday | status | users_id ----+--------------+---------------------+----------+-----------+-----------------------------------+---------- 4 | no google-id | 2023-6-20 | 100 | Tuesday | {"check,check,check,check,check"} | 3 5 | no google-id | 2023-6-21 | 0 | Wednesday | {} | 3 3 | no google-id | 2023-6-19 | 100 | Monday | {"check,check,check,check,check"} | 3 6 | no google-id | 2023-6-28 | 0 | Wednesday | {} | 3 7 | no google-id | 2023-6-29 | 0 | Thursday | {} | 3 8 | no google-id | 2023-6-30 | 0 | Friday | {} | 3 1 | | 2023-01-25 00:00:00 | 10 | thursday | {nope,nope,nope,nope,nope} | 1 2 | | 2023-04-01 00:00:00 | 10 | monday | {"nope,nope,nope,nope,check"} | 2