[OH-Dev] [issue677] OpenHatch migrations should be tested (and fixed) with postgresql
Asheesh Laroia
bugs at openhatch.org
Mon Feb 13 19:09:53 UTC 2012
New submission from Asheesh Laroia <asheesh at asheesh.org>:
There are a few different database errors that one gets when running our
migrations on Postgres.
The following is one of them:
2012-02-13 14:07:03,860 execute:145 DEBUG south execute "ALTER TABLE
"search_projectinvolvementquestion" ALTER COLUMN "is_bug_style" TYPE boolean,
ALTER COLUMN "is_bug_style" SET NOT NULL, ALTER COLUMN "is_bug_style" SET
DEFAULT %s ;" with params "[False]"
Traceback (most recent call last):
File "mysite/manage.py", line 25, in <module>
execute_manager(mysite.settings)
File "/app/vendor/packages/Django/django/core/management/__init__.py", line
438, in execute_manager
utility.execute()
File "/app/vendor/packages/Django/django/core/management/__init__.py", line
379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/vendor/packages/Django/django/core/management/base.py", line 191,
in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/vendor/packages/Django/django/core/management/base.py", line 220,
in execute
output = self.handle(*args, **options)
File "/app/vendor/packages/Django/django/core/management/base.py", line 351,
in handle
return self.handle_noargs(**options)
File "/app/vendor/packages/south/south/management/commands/syncdb.py", line
99, in handle_noargs
management.call_command('migrate', **options)
File "/app/vendor/packages/Django/django/core/management/__init__.py", line
166, in call_command
return klass.execute(*args, **defaults)
File "/app/vendor/packages/Django/django/core/management/base.py", line 220,
in execute
output = self.handle(*args, **options)
File "/app/vendor/packages/south/south/management/commands/migrate.py", line
105, in handle
ignore_ghosts = ignore_ghosts,
File "/app/vendor/packages/south/south/migration/__init__.py", line 191, in
migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/app/vendor/packages/south/south/migration/migrators.py", line 221, in
migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/app/vendor/packages/south/south/migration/migrators.py", line 292, in
migrate_many
result = self.migrate(migration, database)
File "/app/vendor/packages/south/south/migration/migrators.py", line 125, in
migrate
result = self.run(migration)
File "/app/vendor/packages/south/south/migration/migrators.py", line 99, in run
return self.run_migration(migration)
File "/app/vendor/packages/south/south/migration/migrators.py", line 81, in
run_migration
migration_function()
File "/app/vendor/packages/south/south/migration/migrators.py", line 57, in
<lambda>
return (lambda: direction(orm))
File
"/app/mysite/../mysite/search/migrations/0036_questions_with_bugs_as_answers.py", line
40, in forwards
db.alter_column('search_projectinvolvementquestion', 'is_bug_style',
orm['search.projectinvolvementquestion:is_bug_style'])
File "/app/vendor/packages/south/south/db/generic.py", line 382, in alter_column
flatten(values),
File "/app/vendor/packages/south/south/db/generic.py", line 150, in execute
cursor.execute(sql, params)
File "/app/vendor/packages/Django/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File
"/app/vendor/packages/Django/django/db/backends/postgresql_psycopg2/base.py",
line 44, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: column "is_bug_style" cannot be cast to type
"pg_catalog.bool"
I discovered this while attempting to start an instance of the OpenHatch code on
Heroku's "cedar" stack.
It would be good to add Postgres as a supported database so that people can run
OpenHatch on Heroku if they want, or just if they want to use Postgres on their
own machines.
----------
messages: 2992
nosy: paulproteus
priority: wish
status: unread
title: OpenHatch migrations should be tested (and fixed) with postgresql
__________________________________________
Roundup issue tracker <bugs at openhatch.org>
<https://openhatch.org/bugs/issue677>
__________________________________________
More information about the Devel
mailing list