Page 1 of 1

News duplicated entry in db

Posted: Tue Sep 13, 2011 11:01 pm
by Aureli
Hi,

I have imported the contents of cms_module_news from one installation into another installation of a different site.

All worked well until I created a new news item. When I submit the new item I get this error:

Code: Select all

DEBUG: SQL = INSERT INTO cms_module_news (news_id, news_category_id, news_title, news_data, summary, status, news_date, start_time, end_time, create_date, modified_date,author_id,news_extra,news_url) VALUES (20,'1','q','q','q','published','2011-09-13 15:45:12',NULL,NULL,'2011-09-13 15:45:23','2011-09-13 15:45:23','1','','')
Duplicate entry '20' for key 'PRIMARY'
You can see that the value for "news_id" is 20, which means that even though the table is populated with 108 entries, the module starts with a value of 0. Yes, I have tried to create 20 new items and each try it increments the number.

One solution is to keep creating new items and getting errors until it give an id value higher than 108 and then it will work, but I'd have to submit news 88 times before this happens!!

Do you have any shorter solution to this? is there a way I can manually alter the starting point of the value of "news_id"?

Thanks.

A.

Re: News duplicated entry in db

Posted: Thu Apr 11, 2013 9:49 am
by Franz
Hi!

I have the same problem!

I solved with a change in the table cms_module_news_seq!

By.

Franz

Sorry for my English!

Re: News duplicated entry in db

Posted: Tue Apr 16, 2013 8:35 pm
by Dr.CSS
If you are imported all the articles from one sites News to another you may want to drop all the existing News tables first...

Re: News duplicated entry in db

Posted: Tue Apr 16, 2013 9:44 pm
by Aureli
Thanks, that makes sense!

I don't have that site anymore but good to know the solution for the future.

A.