Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of datatypes when migrating schema #21

Closed
agseekda opened this issue Aug 9, 2017 · 3 comments
Closed

Handling of datatypes when migrating schema #21

agseekda opened this issue Aug 9, 2017 · 3 comments
Assignees
Milestone

Comments

@agseekda
Copy link

agseekda commented Aug 9, 2017

Hi,

We are currently evaluating pg_chameleon for migrating our database from mysql to postgresql with minimal downtime.

One blocking issue we found is that in mysql booleans are represented as tinyint(1) or bit(1) while in postgresql our ORM mapper expects real booleans.

We didn't find a way to do this kind of transformation with pg_chameleon. Other tools like pgloader have this built in.

Question is can this functionality be added?

@the4thdoctor
Copy link
Owner

the4thdoctor commented Aug 9, 2017

Hi, currently I have no flexibility in type handling. I need to check if is possible to have it implemented in the version 1 or if I have to bump it to the version 2 (probably out by the end of the year).

@the4thdoctor
Copy link
Owner

the override is possible, however the risk of breaking the replica is very concrete.
for example if you insert a value larger that 1 in a tinyint(1) the boolean on postgres will cause an error.
I need to investigate a solid way to make it work so adding this feature to the version 1.7 at least.

@the4thdoctor
Copy link
Owner

@agseekda you can test the functionality on the branch type_override. The configuration file requires a mapping for the type override. the configuration-example.yaml have the example override for tinyint(1).
The override_to key specifies the type to override. This must be a postgresql type.
The override_tables allow to specify which tables will get the override. Leave the star if you want to apply the override to all the tables.
Currently the override works only at create time.
Please let me know if it works for you.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants