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

  • Home
  • SEARCH
  • 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 3340112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:34:12+00:00 2026-05-18T00:34:12+00:00

I’m working with an OS project that uses South to migrate the database. I’m

  • 0

I’m working with an OS project that uses South to migrate the database.
I’m building a new database from scratch and I want to make sure South is setup so I can easily update the database in the future.

It seems this process should be:

  1. create the db
  2. syncdb
  3. migrate

However, when I try to migrate the databases, one of the the earlier migrations(migration 0004 and they go to 0009) throws an exception:

ValueError: You cannot add a null=False column without a default value.

I don’t understand how to add a default value to migration 0004 so this exception isn’t thrown.

The migrations don’t need to be run through because the database is empty.

However, south_migrationhistory must contain a list of all migrations and when they were applied.

I tried to hack it and just add migration 0009 to the database manually, but this threw another error because the intermediary migrations had not been run.
I also tried to add a field to database to see if I could figure out the syntax of add_column would look like with a default value of 0 supplied.
The format looks totally different than these older migrations.

Here are the 2 different versions of the add_column syntax:

#0004 syntax:  
db.add_column('experiments_dailyreport', 'test_group_size', orm['experiments.dailyreport:test_group_size'])
#0009 syntax:
syntax db.add_column('experiments_dailyreport', 'test_group_size', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

So, I’m guessing there was a change in the South code between when 0004 was created and today.

Is there a way to build the database with syncdb and then somehow update south_migrationhistory without running manage.py migrate ?

If you have an existing app with South migrations, how would you build a new database from scratch?

I can’t migrate because there is no default set on a integer field.
How do I set a default in an older migration? The field doesn’t even exist anymore.

syntaxes attempted:

db.add_column('experiments_dailyreport', 'test_group_size', orm['experiments.dailyreport:test_group_size'], {'default': 0})
#throws ValueError: You cannot add a null=False column without a default value.
db.add_column('experiments_dailyreport', 'test_group_size', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
#throws AttributeError: Migration instance has no attribute 'gf'

I’m using South-0.7.2-py2.7.egg

  • 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-18T00:34:13+00:00Added an answer on May 18, 2026 at 12:34 am

    Andrew Godwin provided an answer:

    Yes, use:

    ./manage.py syncdb --all  
    

    then:

    ./manage.py migrate --fake  
    

    This will, however, also ignore any migrations that add in data to the database.

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

Sidebar

Related Questions

No related questions found

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.