Skip to content
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

sql file #7

Open
Rstacx opened this issue Dec 8, 2023 · 1 comment
Open

sql file #7

Rstacx opened this issue Dec 8, 2023 · 1 comment

Comments

@Rstacx
Copy link

Rstacx commented Dec 8, 2023

{
  code: '23503',
  details: 'Key (author_id)=(ffa6add6-903f-4265-956e-388065b67e14) is not present in table "profiles".',
  hint: null,
  message: 'insert or update on table "drafts" violates foreign key constraint "drafts_author_id_fkey"'
}

Can you give me the updated sql?

@MateoWartelle
Copy link

{
  code: '23503',
  details: 'Key (author_id)=(ffa6add6-903f-4265-956e-388065b67e14) is not present in table "profiles".',
  hint: null,
  message: 'insert or update on table "drafts" violates foreign key constraint "drafts_author_id_fkey"'
}

Can you give me the updated sql?

The sql file is missing the author id column and the status column.

create table
  public.drafts (
    id uuid not null default gen_random_uuid (),
    category_id uuid null,
    title text null default 'Untitled'::text,
    slug text null default 'untitled'::text,
    image text null,
    description text null,
    content text null,
    created_at timestamp with time zone not null default now(),
    updated_at timestamp without time zone null,
    author_id uuid null,
    published boolean null default false,
    status text null default 'draft'::text,
    constraint drafts_pkey primary key (id),
    constraint drafts_author_id_fkey foreign key (author_id) references profiles (id),
    constraint drafts_category_id_fkey foreign key (category_id) references categories (id) on delete cascade
  ) tablespace pg_default;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants