[openstack-dev] [Ceilometer] Need help with Alembic...
jaypipes at gmail.com
Mon Aug 26 19:34:44 UTC 2013
On 08/26/2013 03:27 PM, Monsyne Dragon wrote:
> You should be able to get the dialect_name from the context in the alembic
> migration and do something like:
> if dialect_name == 'sqlite':
> #Do whacky sqlite stuff hereŠ
> #sane db migration hère...
Hmm, ok, thanks for the suggestion, Dragon, I'll check into that.
> On 8/26/13 1:59 PM, "Sandy Walsh" <sandy.walsh at rackspace.com> wrote:
>> I'm getting the same problem with a different migration (mine is
>> complaining that a column already exists)
>> I've compared it to the other migrations and it seems fine.
>> On 08/26/2013 02:34 PM, Jay Pipes wrote:
>>> Hey all,
>>> I'm trying to figure out what is going wrong with my code for this
>>> I had previously added a sqlalchemy-migrate migration script to add an
>>> event_type table, and had that working, but then was asked to instead
>>> use Alembic for migrations. So, I removed the sqlalchemy-migrate
>>> migration file and added an Alembic migration .
>>> Unfortunately, I am getting the following error when running tests:
>>> OperationalError: (OperationalError) table event_type already exists
>>> u'\nCREATE TABLE event_type (\n\tid INTEGER NOT NULL, \n\t"desc"
>>> VARCHAR(255), \n\tPRIMARY KEY (id), \n\tUNIQUE ("desc")\n)\n\n' ()
>>> The migration adds the event_type table. I've seen this error occur
>>> before when using SQLite due to SQLite's ALTER TABLE statement not
>>> allowing the rename of a column. In the sqlalchemy-migrate migration, I
>>> had a specialized SQLite migration upgrade  and downgrade  script,
>>> but I'm not sure how I am supposed to handle this in Alembic. Could
>>> someone help me out?
>>> OpenStack-dev mailing list
>>> OpenStack-dev at lists.openstack.org
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
More information about the OpenStack-dev