strapi / strapi-starter-next-corporate

Next.js starter for creating a corporate site with Strapi.
https://strapi-starter-next-corporate.vercel.app
MIT License
346 stars 95 forks source link

Unable to add new page #76

Open eastcoastinfosec opened 2 years ago

eastcoastinfosec commented 2 years ago

I was getting a goofy error trying to add a new page after deploying the template.

error: insert into "components_meta_metadata" ("meta_description", "meta_title", "twitter_card_type") values ($1, $2, $3) returning "id" - duplicate key value violates unique constraint "components_meta_metadata_pkey"

I'm using postgres. It seems like the id primary key sequence has to be altered. SELECT FROM components_meta_metadata_id_seq; last_value for me was showing 3, but the template populated up to 10; SELECT setval('components_meta_metadata_id_seq', 11, true); lead me to a second but same issue on the pages SELECT FROM pages_id_seq; last_value was set to one, template populated 8; SELECT setval('pages_id_seq', 9, true);

I'm going to go through the rest of the sequences, I didn't see how to change this in the strapi so I did it through SQL. I'd be interested in seeing where this exists in the strapi so I can edit and send a PR