Skip to content

sqlite and migrations (south) problem #213

Closed
mfa opened this Issue Oct 26, 2009 · 9 comments

7 participants

@mfa
mfa commented Oct 26, 2009

File "cms/migrations/0015_modified_by_added.py", line 11, in forwards
db.add_column('cms_publicpage', 'changed_by', orm['cms.publicpage:changed_by'])
File "south/db/sqlite3.py", line 20, in add_column
raise ValueError("You cannot add a null=False column without a default value.")
ValueError: You cannot add a null=False column without a default value.

@digi604
Divio AG member
digi604 commented Oct 27, 2009

how is the support for sqllite in south nowadays? if you define a default value... does everything else run?

@mfa
mfa commented Oct 27, 2009

I first used sqlite with django-cms-2.0 and had no problems. but without using south.
because of the recent changes I had to use south/migrations. this seems not to work atm with sqlite :(
so this bug is maybe a south-issue, but why does all 14 migrations before work smoothly?
So since yesterday I'm using postgres to run my testsite with django-cms-2.0.

@digi604
Divio AG member
digi604 commented Nov 9, 2009

could you check with RC3 if this works with sqllite?

@fccoelho

I can confirm that the problem is still there for sqlite with the rc3

@brierwood

I had (what looks to me), like a slightly different manifestation of this problem with the error:

sqlite3.IntegrityError: south_migrationhistory.id may not be NULL

I'm trusting that the person who marked my original as a dup is more in-the-know than I.

Is there a simple workaround that I could use for now? Or is the whole notion of using sqlite with south for local development really not a good idea at this juncture?

@digi604
Divio AG member
digi604 commented Nov 19, 2009

have a look here for a possible workaround: http://github.com/digi604/django-cms-2.0/issues/#issue/142

@DrMeers
DrMeers commented Dec 4, 2009

This can be easily fixed:

--- a/cms/migrations/0015_modified_by_added.py
+++ b/cms/migrations/0015_modified_by_added.py
@@ -112,8 +112,8 @@ class Migration:
     'user': ('models.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
     },
     'cms.publicpage': {
-            'changed_by': ('models.CharField', [], {'max_length': '70'}),
-            'created_by': ('models.CharField', [], {'max_length': '70'}),
+            'changed_by': ('models.CharField', [], {'max_length': '70', 'default': '""'}),
+            'created_by': ('models.CharField', [], {'max_length': '70', 'default': '""'}),
     'author': ('models.ForeignKey', [], {'to': "orm['auth.User']"}),
     'creation_date': ('models.DateTimeField', [], {'default': 'datetime.datetime(2009, 6, 30, 4, 55, 13, 502271)'
     'id': ('models.AutoField', [], {'primary_key': 'True', 'blank': 'True'}),

However this only gets you a little further down the path...

@cuker
cuker commented Feb 11, 2010

According to the south tutorial you should add a keep_default=False when adding the column:

http://south.aeracode.org/wiki/Tutorial3

I have used south on some rather complex sqlite databases without any issues (this was mainly for testing purposes, in production I use mysql or postgres)

@ojii
ojii commented Sep 17, 2010

3rd party issue, closing

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.