Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration error with django cms 2.3 + django 1.4 + postgresql 9.1.4 #1343

Closed
ludovic-gasc opened this issue Jul 11, 2012 · 10 comments
Closed

Comments

@ludovic-gasc
Copy link

With a fresh install with cms.plugins.* enabled, I've these errors below.

The problem is that I can't add other cms.plugins.

To fix that, I've disabled south as suggested by: http://south.aeracode.org/ticket/332#comment:12

This quick-n-dirty solution should be suggested in the documentation to help the new comers, isn't it ?

./manage.py migrate
Running migrations for cms:
 - Migrating forwards to 0035_auto__add_field_globalpagepermission_can_view__add_field_pagepermissio.
 > cms:0001_initial
 > cms:0002_auto_start
 > cms:0003_remove_placeholder
 > cms:0004_textobjects
 > cms:0005_mptt_added_to_plugins
 > text:0001_initial
 > text:0002_freeze
 > cms:0006_apphook
 > cms:0007_apphook_longer
 > cms:0008_redirects
 > cms:0009_added_meta_fields
 > cms:0010_5char_language
 > cms:0011_title_overwrites
 > cms:0012_publisher
 > text:0003_publisher
 > snippet:0001_initial
 > snippet:0002_publisher
 > picture:0001_initial
 > picture:0002_link_rename
 > picture:0003_freeze
 > picture:0004_publisher
 > link:0001_initial
 > link:0002_link_rename
 > link:0003_page_link
 > link:0004_larger_link_names
 > link:0005_publisher
 > file:0001_initial
 > file:0002_freeze
 > file:0003_publisher
 > cms:0013_site_copy
 > cms:0014_sites_removed
 > cms:0015_modified_by_added
 > cms:0016_author_copy
 > cms:0017_author_removed
 > cms:0018_site_permissions
 > cms:0019_public_table_renames
 > text:0004_table_rename
FATAL ERROR - The following SQL query failed: ALTER TABLE "text_text_id_seq" RENAME TO "cmsplugin_text_id_seq";
The error was: relation "text_text_id_seq" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "text_text_pkey" RENAME TO "cmsplugin_text_pkey";
The error was: relation "text_text_pkey" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "text_publictext_id_seq" RENAME TO "cmsplugin_textpublic_id_seq";
The error was: relation "text_publictext_id_seq" does not exist

 > text:0005_publisher2
 > snippet:0003_table_rename
FATAL ERROR - The following SQL query failed: ALTER TABLE "snippet_snippetptr_id_seq" RENAME TO "cmsplugin_snippetptr_id_seq";
The error was: relation "snippet_snippetptr_id_seq" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "snippet_snippetptr_pkey" RENAME TO "cmsplugin_snippetptr_pkey";
The error was: relation "snippet_snippetptr_pkey" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "snippet_publicsnippetptr_id_seq" RENAME TO "cmsplugin_snippetptrpublic_id_seq";
The error was: relation "snippet_publicsnippetptr_id_seq" does not exist

 > snippet:0004_publisher2
 > picture:0005_table_rename
FATAL ERROR - The following SQL query failed: ALTER TABLE "picture_picture_id_seq" RENAME TO "cmsplugin_picture_id_seq";
The error was: relation "picture_picture_id_seq" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "picture_picture_pkey" RENAME TO "cmsplugin_picture_pkey";
The error was: relation "picture_picture_pkey" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "picture_publicpicture_id_seq" RENAME TO "cmsplugin_picturepublic_id_seq";
The error was: relation "picture_publicpicture_id_seq" does not exist

 > picture:0006_float_added
 > picture:0007_publisher2
 > link:0006_table_rename
FATAL ERROR - The following SQL query failed: ALTER TABLE "link_link_id_seq" RENAME TO "cmsplugin_link_id_seq";
The error was: relation "link_link_id_seq" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "link_link_pkey" RENAME TO "cmsplugin_link_pkey";
The error was: relation "link_link_pkey" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "link_publiclink_id_seq" RENAME TO "cmsplugin_linkpublic_id_seq";
The error was: relation "link_publiclink_id_seq" does not exist

 > link:0007_publisher2
 > file:0004_table_rename
FATAL ERROR - The following SQL query failed: ALTER TABLE "file_file_id_seq" RENAME TO "cmsplugin_file_id_seq";
The error was: relation "file_file_id_seq" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "file_file_pkey" RENAME TO "cmsplugin_file_pkey";
The error was: relation "file_file_pkey" does not exist

FATAL ERROR - The following SQL query failed: ALTER TABLE "file_publicfile_id_seq" RENAME TO "cmsplugin_filepublic_id_seq";
The error was: relation "file_publicfile_id_seq" does not exist

 > file:0005_publisher2
 > cms:0020_advanced_permissions
 > cms:0021_publisher2
 > cms:0022_login_required_added
 > cms:0023_plugin_table_naming_function_changed
 > cms:0024_added_placeholder_model
 > cms:0025_placeholder_migration
 > cms:0026_finish_placeholder_migration
 > cms:0027_added_width_to_placeholder
 > cms:0028_limit_visibility_in_menu_step1of3
 > cms:0029_limit_visibility_in_menu_step2of3_data
 > cms:0030_limit_visibility_in_menu_step3of3
 > cms:0031_improved_language_code_support
 > cms:0032_auto__del_field_cmsplugin_publisher_public__del_field_cmsplugin_publis
 > cms:0033_auto__del_field_title_publisher_is_draft__del_field_title_publisher_st
 > cms:0034_auto__chg_field_title_language__chg_field_cmsplugin_language__add_fiel
 > cms:0035_auto__add_field_globalpagepermission_can_view__add_field_pagepermissio
 - Loading initial data for cms.
Installed 0 object(s) from 0 fixture(s)
Running migrations for menus:
 - Migrating forwards to 0001_initial.
 > menus:0001_initial
 - Loading initial data for menus.
Installed 0 object(s) from 0 fixture(s)
Running migrations for link:
 - Migrating forwards to 0008_mailto.
 > link:0008_mailto
 - Loading initial data for link.
Installed 0 object(s) from 0 fixture(s)
Running migrations for picture:
 - Migrating forwards to 0008_longdesc_added.
 > picture:0008_longdesc_added
 - Loading initial data for picture.
Installed 0 object(s) from 0 fixture(s)
Running migrations for file:
- Nothing to migrate.
 - Loading initial data for file.
Installed 0 object(s) from 0 fixture(s)
Running migrations for snippet:
 - Migrating forwards to 0005_template_added.
 > snippet:0005_template_added
 - Loading initial data for snippet.
Installed 0 object(s) from 0 fixture(s)
Running migrations for text:
 - Migrating forwards to 0006_2_1_4_upgrade.
 > text:0006_2_1_4_upgrade
 - Loading initial data for text.
Installed 0 object(s) from 0 fixture(s)
@beniwohli
Copy link
Contributor

We already suggest to run syncdb --all on new installs, which runs the stock syncdb even on south-enabled apps:

http://django-cms.readthedocs.org/en/2.3/getting_started/tutorial.html#fresh-install

Even better would be to fix the actual migration error. Any ideas why it happens?

@yakky
Copy link
Member

yakky commented Jul 11, 2012

We encountered this while investigating on #355

According to this https://groups.google.com/forum/?fromgroups#!topic/south-users/UcFpgQyDACo, South over time developed some incompatibilities and subtle behaviour changes.

South 0.7.3 runs fine, but it's not a long term options; syncdb --all / migrate --fake is a far better solution ATM.

Long term maybe rewriting migration history maybe the only solution, but it will cause many horror stories upon upgrade :)
Maybe syncing this with CMS_MODERATOR removal (which will break pretty much everything, I guess) could ease the pain.

Maybe a more apparent notice in the documentation about this could help.

@ludovic-gasc
Copy link
Author

Oops, I've used syncdb --all option during the first install to test, but during the clean-up of the database to create the real website, I've forgotten --all.
migrate --fake is important or it's only to have some fake data in the DB ?

@yakky
Copy link
Member

yakky commented Jul 11, 2012

--fake is important to keep south history in sync with the real db status; it 'fakes' the migrations inserting them in the south history table without actually changing the database structure, so you can execute further migrations (from your own or third-party applications). See south documentation (http://south.readthedocs.org/en/latest/tutorial/) for further details

@ludovic-gasc
Copy link
Author

Ok, I close this issue because you already have an open issue about it: #355

Thanks a lot guys for your help !
I've just finished my first Website with Django-cms, I'm very impressed, the multilinguism works very well.
In the past, I'd used a lot jahia, ez-publish, Joomla, Wordpress and Drupal, you're the more flexible I've tested for now, and very easy to handle.

The latest thing I must understand is how to make "content types" (it's like a model in the Drupal world) with Django-cms, because I will need to force the structure of the content.
If I understand correctly, I can make a classical django model + admin stuff, and after I integrate directly in the template or I create a CMS plugin if I want the editor can place himself the "block content", right ?

@yakky
Copy link
Member

yakky commented Jul 12, 2012

@GMLudo You're right: you can just create a standard django application and integrate it in the CMS.
Plugins let you items from your application in a normal CMS page (say: latest news in a page sidebar), with apphooks you can attach your application views on a CMS page and let your application manage navigation flow from that point on.
Look here for further directions: http://django-cms.readthedocs.org/en/2.3/extending_cms/extending_examples.html
Basically apphook

@yakky
Copy link
Member

yakky commented Jul 12, 2012

As for closing this issue, maybe leaving it open would be useful as it more correctly represent the state of the things. #355 is so old that's not really much useful to track the actual migration situation.
@piquadrat what's your opinion?

@ludovic-gasc
Copy link
Author

@piquadrat Thanks for the link.

You should close #355 and re-open this issue.

@ludovic-gasc
Copy link
Author

Sorry:

- @piquadrat Thanks for the link.
+ @yakky Thanks for the link.

@kAMUS-CRAK
Copy link

vitrual venv only loclal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants