Note that there are some explanatory texts on larger screens.

plurals
  1. PONo Such Column After South Migration
    primarykey
    data
    text
    <p>I had the same issue as the user in this question but the <a href="https://stackoverflow.com/a/4119150/2270375">answer</a> unfortunately did not resolve anything. A few comments about what happened when I followed the given directions:</p> <p>When I tried the <code>--delete-ghost-migrations</code> command I got an error</p> <p><code>The app 'tixeng' does not appear to use migrations.</code></p> <p>I moved forward with the directions and initialized migrations for the app. Then I tried the <code>--delete-ghost-migrations</code> again</p> <pre><code>/Users/AaronPardes/Dropbox/Python/home_repos/squidtix/squidtix/virtualenvironments/squidtixENV/lib/python2.7/site-packages/django/utils/hashcompat.py:9: DeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead DeprecationWarning) Running migrations for tixeng: - Nothing to migrate. - Loading initial data for tixeng. Installed 0 object(s) from 0 fixture(s) </code></pre> <p>I then made the changes to my model, and tried to create a new migration for the changes.</p> <pre><code>^C(squidtixENV)Aarons-MacBook-Pro:squidtix AaronPardes$ ./manage.py schemamigration tixeng --auto + Added field for_sale on tixeng.SquidTic Created 0002_auto__add_field_squidtic_for_sale.py. You can now apply this migration with: ./manage.py migrate tixeng </code></pre> <p>And applying the migration.</p> <pre><code>/Users/AaronPardes/Dropbox/Python/home_repos/squidtix/squidtix/virtualenvironments/squidtixENV /lib/python2.7/site-packages/django/utils/hashcompat.py:9: DeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead DeprecationWarning) Running migrations for tixeng: - Migrating forwards to 0002_auto__add_field_squidtic_for_sale. &gt; tixeng:0002_auto__add_field_squidtic_for_sale FATAL ERROR - The following SQL query failed: CREATE TABLE "_south_new_tixeng_squidtic" ("date_listed" datetime NOT NULL, "event_id" integer NOT NULL, "price" integer NOT NULL, "for_sale" bool NOT NULL DEFAULT 1, "id" integer PRIMARY KEY, "owner_id" integer) The error was: table "_south_new_tixeng_squidtic" already exists ! Error found during real run of migration! Aborting. ! Since you have a database that does not support running ! schema-altering statements in transactions, we have had ! to leave it in an interim state between migrations. ! You *might* be able to recover with: ! The South developers regret this has happened, and would ! like to gently persuade you to consider a slightly ! easier-to-deal-with DBMS (one that supports DDL transactions) ! NOTE: The error which caused the migration to fail is further up. Error in migration: tixeng:0002_auto__add_field_squidtic_for_sale DatabaseError: table "_south_new_tixeng_squidtic" already exists </code></pre> <p>Relevant Information:</p> <p>field being added: <code>models.BooleanField(default = True)</code></p> <p>The migration that is created:</p> <pre><code># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SquidTic.for_sale' db.add_column(u'tixeng_squidtic', 'for_sale', self.gf('django.db.models.fields.BooleanField')(default=True), keep_default=False) def backwards(self, orm): # Deleting field 'SquidTic.for_sale' db.delete_column(u'tixeng_squidtic', 'for_sale') models = { u'accounts.myprofile': { 'Meta': {'object_name': 'MyProfile'}, 'favourite_snack': ('django.db.models.fields.CharField', [], {'max_length': '5'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'mugshot': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 'privacy': ('django.db.models.fields.CharField', [], {'default': "'registered'", 'max_length': '15'}), 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'my_profile'", 'unique': 'True', 'to': u"orm['auth.User']"}) }, u'auth.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, u'auth.permission': { 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, u'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, u'tixeng.squidartist': { 'Meta': {'object_name': 'SquidArtist'}, 'artist_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}) }, u'tixeng.squidevent': { 'Meta': {'object_name': 'SquidEvent'}, 'artist': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['tixeng.SquidArtist']", 'symmetrical': 'False'}), 'event_date': ('django.db.models.fields.DateTimeField', [], {}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'venue': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tixeng.SquidVenue']"}) }, u'tixeng.squidtic': { 'Meta': {'object_name': 'SquidTic'}, 'date_listed': ('django.db.models.fields.DateTimeField', [], {}), 'event': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tixeng.SquidEvent']"}), 'for_sale': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.MyProfile']"}), 'price': ('django.db.models.fields.IntegerField', [], {'default': '0.0'}) }, u'tixeng.squidvenue': { 'Meta': {'object_name': 'SquidVenue'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'street_address': ('django.db.models.fields.CharField', [], {'max_length': '20'}) } } complete_apps = ['tixeng'] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload