Visitar URL original
Unable to create migrations · Issue #652 · feincms/feincms · GitHub
Skip to content

Unable to create migrations #652

Description

@jwadden

I'm attempting to set up a simple "Hello World" app using FeinCMS, however when I try to access the "Page" section of the admin after following the instructions in the "Built-In Page Module" section in the ReadTheDocs documentation I get an error stating "column page_page.publication_date does not exist". It appears that I need to run some migrations in order to get FeinCMS to function, but the software has none built-in.

The documentation does contain a section on setting up migrations yourself, however when I try to follow the instructions there I get an ImportError exception stating "No module named 'myapp.migrate.page'" when I try to run the server (with "myapp" being replaced by the name of the application I'm trying to set up.) Is there any way to resolve this?

Activity

  1. matthiask commented on Apr 23, 2017

    @matthiask
    Member

    The instructions around migrations are lacking. I'm not sure why, but you have to create the module referenced in MIGRATION_MODULES yourself, so:

    mkdir -p myapp/migrate/page
    touch myapp/migrate/__init__.py myapp/migrate/page/__init__.py
    

    After these steps, the initial ./manage.py makemigrations page and subsequent ./manage.py migrate calls should actually do something.

  2. jwadden commented on Apr 23, 2017

    @jwadden
    Author

    The instructions didn't mention anything about creating a /page subdirectory within the /migrate directory. I believe they should be updated to reflect this.

    After creating a /page subdirectory (and a /medialibrary subdirectory, which also seems to be necessary to get those instructions to work) and populating them with empty __init__.py files I was able to create migrations for the page and medialibrary apps, however those migrations still aren't being applied when I run the django-admin migrate command and I'm still getting the same error in the admin. Are there additional steps I need to perform?

  3. matthiask commented on Apr 23, 2017

    @matthiask
    Member

    That's very strange. This is the first time I hear that migrations can be created, but not applied. Does specifying the app help, something like ./manage.py migrate medialibrary?

  4. jwadden commented on Apr 23, 2017

    @jwadden
    Author

    I've already tried that. It says that there are no migrations to apply.

  5. jwadden commented on Apr 23, 2017

    @jwadden
    Author

    It looks like the problem was that the migrations were created (somewhere) and run during one of my previous attempts to fix this issue so Django didn't recognize the newly-created migrations as still needing to be applied. When I undid the previous migrations (which I was able to do using a migrate medialibrary zero command for medialibrary but which I needed to do manually on the database after --fake-ing the zero-migration for page) the new ones were able to be applied and the admin now works.

    I would strongly advise updating the documentation for this app; setting up a simple "Hello World" application shouldn't be this much of a minefield.

  6. matthiask commented on Oct 17, 2017

    @matthiask
    Member

    That's absolutely true, also, it just came up again in #658...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions