First time here? Check out the FAQ!
2

Errors in running migrations

Hello, I am trying to install/running askbot in my local machine(apache + mysql + windows7). In the procedure of migrations, I met the following errors. How to fix this. Thanks in advance.

 > askbot:0020_auto__add_field_repute_comment__chg_field_repute_question
 ! 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:   = ALTER TABLE `repute` DROP COLUMN `com
ment` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS.
 ! NOTE: The error which caused the migration to fail is further up.
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\managem
ent\__init__.py", line 438, in execute_manager
    utility.execute()
  File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\managem
ent\__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\managem
ent\base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\managem
ent\base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\management\com
mands\migrate.py", line 105, in handle
    ignore_ghosts = ignore_ghosts,
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\__in
it__.py", line 191, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 221, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, datab
ase)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 292, in migrate_many
    result = self.migrate(migration, database)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 125, in migrate
    result = self.run(migration)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 99, in run
    return self.run_migration(migration)
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 81, in run_migration
    migration_function()
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\migration\migr
ators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "C:\Python27\lib\site-packages\askbot-0.7.26-py2.7.egg\askbot\migrations\
0020_auto__add_field_repute_comment__chg_field_repute_question.py", line 15, in
forwards
    db.alter_column(u'repute', 'question_id', self.gf('django.db.models.fields.r
elated.ForeignKey')(to=orm['askbot.Question'], null=True, blank=True))
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\db\generic.py"
, line 397, in alter_column
    field.rel.to._meta.get_field(field.rel.field_name).column
  File "C:\Python27\lib\site-packages\south-0.7.3-py2.7.egg\south\db\generic.py"
, line 150, in execute ...
(more)
Evgeny's avatar
13.2k
Evgeny
updated 2011-10-17 07:19:34 -0600
josseph's avatar
21
josseph
asked 2011-10-17 01:51:44 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

I suspect that your storage engine is InnoDB - could you check pls?

To check this - log in to the database and type:

show create table question;

In the end of the output it will tell which storage engine is used.

At the moment Askbot does not support InnoDB, but I put this on todo list - http://bugs.askbot.org/issues/106.

It will be best if you switch to PostgresQL or if you want to use MySQL - configure it for MyISAM engine.

Another thought - if you are just trying askbot then try sqlite3 database, it works just fine for the purpose and there is nothing extra to install and configure.

Evgeny's avatar
13.2k
Evgeny
updated 2011-10-17 08:16:02 -0600, answered 2011-10-17 08:14:26 -0600
edit flag offensive 0 remove flag delete link

Comments

yes, the storage engine is Innodb. I feel It is automatically generated by askbot scripts. I will try to manually modify it to myisam. thanks.

josseph's avatar josseph (2011-10-17 21:21:45 -0600) edit

When I tried to convert table storage type. I met this problem: #1217 - Cannot delete or update a parent row: a foreign key constraint fails

josseph's avatar josseph (2011-10-17 21:29:11 -0600) edit

You probably did not go too far, so you can just rebuild the database in MyISAM - there is a way to set default storage engine in your my.cnf file. http://dev.mysql.com/doc/refman/5.1/en/storage-engine-setting.html. Try default-storage-engine=MYISAM.

Evgeny's avatar Evgeny (2011-10-17 21:44:27 -0600) edit
add a comment see more comments