Page 1 of 1
entry id defaulting to zero (0)
Posted: Tue Nov 23, 2010 6:04 pm
by ianinc
Currently when someone posts a blog the id value in serendipity_entries defaults to zero and then won't show up. Any help would be much appreciated.
Re: entry id defaulting to zero (0)
Posted: Wed Nov 24, 2010 10:20 pm
by garvinhicking
Hi!
Which s9y version and which database backend? The id should autoincrement. Maybe you imported a SQL dump and forget to export autoincrement keys?
Regards,
Garvin
Re: entry id defaulting to zero (0)
Posted: Tue Dec 14, 2010 5:12 pm
by ianinc
Thank you for the response. I'm on version 1.5.2. Any direction would be much appreciated.
Re: entry id defaulting to zero (0)
Posted: Thu Dec 16, 2010 9:58 am
by garvinhicking
Hi!
I also need your database type... and what about my question about migration?
Regards,
Garvin
Re: entry id defaulting to zero (0)
Posted: Tue Jan 04, 2011 7:56 pm
by ianinc
I was kind of handed this blog so I'm not sure what happened. I think it was upgraded right before it was passed on to me but I don't know how they did it. The database is phpMyAdmin.
Re: entry id defaulting to zero (0)
Posted: Tue Jan 04, 2011 11:28 pm
by garvinhicking
Hi!
ianinc wrote:I was kind of handed this blog so I'm not sure what happened. I think it was upgraded right before it was passed on to me but I don't know how they did it. The database is phpMyAdmin.
phpMyAdmin is a tool; but surely you mean MySQL. You'll need to check if your serendipity_entries has a autoincrement primary key on the "id" column.
Ideally, you should get someone proficient with MySQL to check your migration path, because obviously whoever executed the migration/upgrade didn't properly do that...
Regards,
Garvin
Re: entry id defaulting to zero (0)
Posted: Wed Jan 05, 2011 4:01 pm
by ianinc
I surely do mean MySQL. I checked the entries column and tried to add the autoincrement primary key but it gave me an error "#1062 - Duplicate entry '26' for key 1". I don't live in an ideal world right now so I need to fix this. Would like any help you could give me. Thanks.
Re: entry id defaulting to zero (0)
Posted: Wed Jan 05, 2011 5:00 pm
by garvinhicking
ianinc wrote:I surely do mean MySQL. I checked the entries column and tried to add the autoincrement primary key but it gave me an error "#1062 - Duplicate entry '26' for key 1". I don't live in an ideal world right now so I need to fix this. Would like any help you could give me. Thanks.
Hi!
Adding an autoincrement later is a bit hard; how many entries do you have? I'd edit each row and give it a unique ID, so that after that you can add the autoincrement.
If you have too many entries with the same ID, you would need to export the table as an SQL dump WITHOUT the "id" column, then empty the table, then add the autincrement key and then re-import the SQL dump. But the first method would be better because it involves less points of failures
HTH,
Garvin
Re: entry id defaulting to zero (0)
Posted: Wed Jan 05, 2011 9:08 pm
by ianinc
there was only about 30 so I plugged in sequential numbers over that and then I was able to edit the entries column with the primary key autoincrement. Worked like a charm, thanks for the help.