Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:14:33+00:00 2026-05-29T20:14:33+00:00

I have a django application and until now I used sqLite as database backend.

  • 0

I have a django application and until now I used sqLite as database backend. Now when it’s quite close to production I thought of moving it all to mySQL which will be used on the box.

I reconfigured my settings to a mysql database and run

manage.py syncdb --migrate

it started creating tables and all but failed in the first (out of 40) migration with an old error (can’t insert blob without key length and all that).

I first thought of manually fixing the migration files but quickly realized there is too much manual work.

So I thought ok I’ll run manage.py migrate core 0040 (the last migration and that will do the trick) but it still attempts to run the initial one as well:

File "D:\~Sasha\Portman\core\migrations\0001_initial.py", line 23, in forwards
  ('name', self.gf('django.db.models.fields.TextField')(unique=True)),
... error message

Is there a way to migrate my models somehow without manually fixing the initial migration file and all the other magic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:14:34+00:00Added an answer on May 29, 2026 at 8:14 pm

    First, you can’t pick and choose migrations to run. migrate core 0040 means run all migrations up to 0040. In other words, it wouldn’t run 0041, but it would run 0001-0040.

    Now, it’s side-stepping your question a bit, but if you have not moved this project to production yet, you don’t actually need all those migrations. Assuming they’re all schemamigrations you can rollback to zero with:

    python manage.py migrate core zero
    

    Then, delete them all (including 0001_initial.py) and simply run again:

    python manage.py schemamigration --initial core
    

    To regenerate the initial migration. It will base it off the current state of your models, negating the need for 40 migrations.

    It’s always a good idea to compress your migrations like this before you move new code to production. Since this is the first launch, you can remove them all and start from scratch, but in future iterations, if you generate 5 migrations during the course of development, before you commit, rollback to before the first of those, then delete those 5 and then generate a new schemamigration. The result is just one migration with all the changes of those 5. Then, you can commit that and migrate in production.

    It may not solve your problem completely here, but it will definitely make things simpler to debug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django application which edits a database table, which another application polls
I have a Django application, and I recently changed the name of the database
I have a Django Application. I want to have all my models to be
I have a django application which talks to a database to which several other
I have a django application, with a module called app Now this module has
HI I have a django application running on app engine and I want to
I have set up a Django application that uses images. I think I have
I have two models in my Django application, for the purposes of storing search
I have a many-to-many relationship in my django application where I use the add
Is it possible to customize a django application to have accept localized date format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.