News duplicated entry in db

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Aureli
Forum Members
Forum Members
Posts: 74
Joined: Wed Aug 06, 2008 10:48 pm

News duplicated entry in db

Post 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.
Franz
New Member
New Member
Posts: 9
Joined: Tue Oct 09, 2007 7:51 am
Location: Verona

Re: News duplicated entry in db

Post 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!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News duplicated entry in db

Post 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...
Aureli
Forum Members
Forum Members
Posts: 74
Joined: Wed Aug 06, 2008 10:48 pm

Re: News duplicated entry in db

Post by Aureli »

Thanks, that makes sense!

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

A.
Post Reply

Return to “The Lounge”