Skip to content

Conversation

@osarrat
Copy link
Member

@osarrat osarrat commented Nov 21, 2016

fixes #1021 "Missing field code in v2.1=>v2.2 migration new fields creation"

fixes #1021 "Missing field code in v2.1=>v2.2 migration new fields creation"
@ghost
Copy link

ghost commented Nov 21, 2016

I would like not to change already merged migration files to prevent database mess. Can you revert and introduce a new migration file that do only the changes you want? (I guess you will have to redefine the entire migrate_budget_fields).

@ghost ghost self-assigned this Nov 21, 2016
@ghost ghost added this to the v2.2-rc2 milestone Nov 21, 2016
@osarrat
Copy link
Member Author

osarrat commented Nov 21, 2016

Thanks for this feedback.
The change is really minor: it just provides some field codes which are not present. Their won't be any impact for developer databases which might have already pass this script on their database: their data will just miss some facultative field codes for a few fields.
Can't we then keep it like that?

@ghost
Copy link

ghost commented Nov 24, 2016

I understand your point but it won't work. Flyway has a strong rule: migration already passed should not be modified: the migration process check all files integrity when booting (via checksum) and will crash everything telling the developer to fix the files. I guess we will have support to do on the mailing-list... people will have to flyway:repair. Adding a new migration file is simple and straightforward and won't raise any failure on the developer side.

Actually, flyway migrations are suitable for physical schema changes but dealing with procedures as its own mechanism in Flyway 4 (we use v3) called repeatable migration that is made for that: it allows you to do things like 1 procedure = 1 file and flyway will detect the file change and re-create the procedure if changed. I think we don't have many procedure so it's not necessary for now... and we lack experiences with that feature so not sure if there is not drawbacks I can't think of.

@ghost ghost removed this from the v2.2-rc2 milestone Nov 24, 2016
@osarrat osarrat changed the title Alternative default code for migration new fields (issue #1021) Alternative default code for migration new fields & latest translated strings Nov 29, 2016
@osarrat
Copy link
Member Author

osarrat commented Nov 29, 2016

I have followed your suggestion, and created a V17 in flyway dir for this new version of the procedure.

I have also added the latest translations.

@osarrat osarrat added this to the v2.2 milestone Nov 29, 2016
@osarrat
Copy link
Member Author

osarrat commented Dec 1, 2016

Hi @numero-six : flyway-migrate is making this build fail.
Can you tell what I should fix in addition ?

@ghost
Copy link

ghost commented Dec 1, 2016

Hi @osarrat

I'm confused... You procedure seems fine to me but it seems that the CREATE TEMPORARY TABLE tmp_migrate_budget_field behave strangely... It seems that it is never dropped even if marked as TEMPORARY. I don't understand why because PostgreSQL is supposed to support that.

Can you try a workaround? Just add

DROP TABLE IF EXISTS tmp_migrate_budget_field;

just before the CREATE TEMPORARY TABLE so we make sure the table creation will work.

Commit fixes #1021  in a way which is compatible with former flyway compatible commit.
Flyway doesn't seem to like Postgres temporary table.
@osarrat
Copy link
Member Author

osarrat commented Dec 5, 2016

Thanks @numero-six for your tip ! It builds now !

ghost pushed a commit that referenced this pull request Dec 6, 2016
@ghost ghost merged commit 3f3ced2 into sigmah-dev:master Dec 6, 2016
@ghost ghost removed their assignment Feb 10, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant