At this point I'm a bit stumped on how to properly do this. Is there an
easy way to resync the sequences in PostgreSQL that I've overlooked?
Otherwise, I'm assuming:
* Dump the data to a file
* Drop Cascade everything
* Re-install
* Import back from the file
I made a brief remark on the wiki page that someone should probably
amplify into some better general migration guideline.
--
--Max Battcher--
http://www.worldmaker.net/
Did you try "django-admin.py sqlsequencereset"? This used to work for me.
Andreas
Yeah, you need to do something like:
ALTER TABLE auth_groups_id_seq RENAME TO auth_group_id_seq;
ALTER TABLE auth_groups ALTER id SET DEFAULT
nextval('public.auth_group_id_seq'::text);
...for each sequence that needs renaming.
Regards,
Jason
This is the one lame thing about PostgreSQL -- when you rename tables,
you have to rename the sequences as well. Here's an example:
ALTER TABLE chicagocrime_wards RENAME TO chicagocrime_ward;
ALTER TABLE chicagocrime_wards_id_seq RENAME TO chicagocrime_ward_id_seq;
ALTER TABLE chicagocrime_ward ALTER COLUMN id DROP DEFAULT;
ALTER TABLE chicagocrime_ward ALTER COLUMN id SET DEFAULT
nextval('public.chicagocrime_ward_id_seq'::text);
I will edit the RemovingTheMagic wiki page to add this example explicitly.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
This was the peculiar incantation I was looking for, thanks. Now I just
have a non-fatal, non-blocking error from the django_content_types table...