AnatolyUss / nmig

NMIG is a database migration tool, written in Node.js and highly inspired by FromMySqlToPostgreSql.
GNU General Public License v3.0
451 stars 83 forks source link

disable triggers for data only migration #113

Closed jhere1 closed 1 year ago

jhere1 commented 1 year ago

disable triggers for data only migration now that client is being created in DataWriter

AnatolyUss commented 1 year ago

Hello Jian, Could you elaborate, why did you copy this snippet from src/DataReader.ts? Did you find something broken?

Thank you

On Tue, Aug 22, 2023 at 5:30 AM Jian He @.***> wrote:

disable triggers for data only migration now that client is being created in DataWriter

You can view, comment on, or merge this pull request online at:

https://github.com/AnatolyUss/nmig/pull/113 Commit Summary

File Changes

(1 file https://github.com/AnatolyUss/nmig/pull/113/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/AnatolyUss/nmig/pull/113, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHR7N37LMUKKOMOE2IM3GLXWQKVDANCNFSM6AAAAAA3ZG2B7Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jhere1 commented 1 year ago

yeah, ran into errors saying foreign key constraints were being violated. The reason is after the refactor, you're no longer using the same "client" used in DataReader. line 49 of DataWriter creates a new client. set_replication_role = replica is not set on this new client, so FK constraints are enforced during the copy. Previously, set_replication_role was set in DataReader and that same client/connection was used in DataLoader code which is now part of DataWriter.