Re: merging old versions

2019-06-21 Thread Chris Withers
>> On Thu, Jun 20, 2019 at 2:37 AM Chris Withers > <mailto:ch...@withers.org>> wrote: >> >> Hi All, >> >> I have some versions that make use of the third party package I no >> longer use, how do I collapse down alembic revisions that hav

merging old versions

2019-06-20 Thread Chris Withers
Hi All, I have some versions that make use of the third party package I no longer use, how do I collapse down alembic revisions that have already been executed everywhere? I found https://stackoverflow.com/questions/34491914/alembic-how-to-merge-all-revision-files-to-one-file but that

Re: unit testing migration code

2017-12-14 Thread Chris Withers
g_one()" 4. drops the database and...that's how you do it ! On Thu, Nov 30, 2017 at 1:54 PM, Chris Withers <ch...@simplistix.co.uk> wrote: Hi All, How would I add test coverage for this sort of code? https://coveralls.io/builds/14408741/source?filename=mortar_mixins%2Fmigrations.py

Re: adding an auto increment column to an existing table

2017-01-18 Thread Chris Withers
On 17/01/2017 15:07, mike bayer wrote: Because there's no data in a brand new table, the server default isn't needed to create the not-null column. No needed, but it is created, isn't that the point of autoincrement=True? for postgresql, autoincrement=True means that if the column is

Re: adding an auto increment column to an existing table

2017-01-10 Thread Chris Withers
le_name='observation') op.create_primary_key('observation_pkey', 'observation', ['id']) ...but how come my original attempt didn't? cheers, Chris On 10/01/2017 08:03, Chris Withers wrote: So, I screwed up and realised I really want an auto-incrementing integer as the primary key for a bu

adding an auto increment column to an existing table

2017-01-10 Thread Chris Withers
So, I screwed up and realised I really want an auto-incrementing integer as the primary key for a bunch of tables. I've changed my models, got all the tests passing and now I need to get the migrations done, I have: op.add_column('observation', sa.Column('id', sa.Integer(),

Re: patterns for automated tests of migrations

2016-12-11 Thread Chris Withers
more elaborate tests involving actual data, this should be a good starting point, though HTH, tom On 23 Nov 2016, at 10:15, Chris Withers <ch...@simplistix.co.uk> wrote: Hi All, How do you go about writing automated tests for a migration? I don't often do this, but when migrations