R
Railway5mo ago
IgnisDa

Updating database row does not work

No description
17 Replies
Percy
Percy5mo ago
Project ID: 6ef7539d-c186-4609-a904-178fd8fa7fa0
IgnisDa
IgnisDaOP5mo ago
6ef7539d-c186-4609-a904-178fd8fa7fa0
IgnisDa
IgnisDaOP5mo ago
this is how the table looks like
No description
Brody
Brody5mo ago
please provide reproducible steps
IgnisDa
IgnisDaOP5mo ago
this is a platform error, i dont have any other details this error is from the railway backend
Brody
Brody5mo ago
yes please provide steps so that anyone can see that error for themselves
IgnisDa
IgnisDaOP5mo ago
create a postgres table with this sturcture and try to update it with the railway postgres editor.
Brody
Brody5mo ago
the structure you have shown is a screenshot, a screenshot is not reproducible
IgnisDa
IgnisDaOP5mo ago
CREATE TABLE public.access_link (
id text PRIMARY KEY,
created_on timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
issued_tokens text[] NOT NULL DEFAULT '{}'::text[],
expires_on timestamp with time zone,
times_used integer NOT NULL GENERATED ALWAYS AS (cardinality(issued_tokens)) STORED,
maximum_uses integer,
is_revoked boolean,
user_id text NOT NULL,
name text NOT NULL,
is_mutation_allowed boolean,
is_demo boolean,
CONSTRAINT access_link_to_user_foreign_key FOREIGN KEY (user_id)
REFERENCES "user" (id) ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE INDEX access_link_pkey ON public.access_link USING btree (id);
CREATE TABLE public.access_link (
id text PRIMARY KEY,
created_on timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
issued_tokens text[] NOT NULL DEFAULT '{}'::text[],
expires_on timestamp with time zone,
times_used integer NOT NULL GENERATED ALWAYS AS (cardinality(issued_tokens)) STORED,
maximum_uses integer,
is_revoked boolean,
user_id text NOT NULL,
name text NOT NULL,
is_mutation_allowed boolean,
is_demo boolean,
CONSTRAINT access_link_to_user_foreign_key FOREIGN KEY (user_id)
REFERENCES "user" (id) ON UPDATE CASCADE ON DELETE CASCADE
);

CREATE INDEX access_link_pkey ON public.access_link USING btree (id);
Brody
Brody5mo ago
and then simply adding a row to that results in the error you shown?
IgnisDa
IgnisDaOP5mo ago
in my case editing one
Brody
Brody5mo ago
what was in the row you edited and what did you edit
IgnisDa
IgnisDaOP5mo ago
probably due to the generated column
acl_UnMjQPh6yW5_ 2024-07-18 15:30:23.814856+00 {eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c3JfT0tuRGlGM3BybFFxIiwiZXhwIjoxNzI5MDE3OTA3LCJpYXQiOjE3MjE1MDExMDcsImp0aSI6IjEyZmJhYzZkLTQ4YTktNDM0NS05MTUzLTllOWY0MmJlMTAzYyIsImFjY2Vzc19saW5rX2lkIjoiYWNsX1VuTWpRUGg2eVc1XyJ9.I4NFD31lCOD-fsb0DrEirHploinHhBp82s29I22K01g} 2024-10-16 15:30:16.37+00 1 \N \N usr_OKnDiF3prlQq Spotify Testing \N t
acl_UnMjQPh6yW5_ 2024-07-18 15:30:23.814856+00 {eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c3JfT0tuRGlGM3BybFFxIiwiZXhwIjoxNzI5MDE3OTA3LCJpYXQiOjE3MjE1MDExMDcsImp0aSI6IjEyZmJhYzZkLTQ4YTktNDM0NS05MTUzLTllOWY0MmJlMTAzYyIsImFjY2Vzc19saW5rX2lkIjoiYWNsX1VuTWpRUGg2eVc1XyJ9.I4NFD31lCOD-fsb0DrEirHploinHhBp82s29I22K01g} 2024-10-16 15:30:16.37+00 1 \N \N usr_OKnDiF3prlQq Spotify Testing \N t
This is the data of the failing error
Brody
Brody5mo ago
I'm sorry but I'm not sure how that answers my question
IgnisDa
IgnisDaOP5mo ago
this is the data of the row that failed. its failing for all rows btw, but yeah this can be used for testing
raf
raf5mo ago
if it's railway error, there should be an error you can trace...
IgnisDa
IgnisDaOP5mo ago
none i can see it does not show any error on the frontend, just fails silently
Want results from more Discord servers?
Add your server