You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/copydbforeignkey.rst
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,28 @@ Prerequisites
12
12
13
13
Before migrating tables with foreign key constraints via copydb there are a couple of things to take care of
14
14
15
-
- Ghostferry needs to be ran with `SkipForeignKeyConstraintsCheck = true`, which will disable ghostferry to check foreign key
15
+
- Ghostferry needs to be ran with ``SkipForeignKeyConstraintsCheck = true``, which will disable ghostferry to check foreign key
16
16
constraints during initialization.
17
17
18
-
- Source DB should be read_only.
18
+
- Source DB should be ``read_only``.
19
+
20
+
- Need to disable foreign key constraint checks on target DB by passing the following config to target db
21
+
22
+
.. code-block:: json
23
+
24
+
"Params": {
25
+
"foreign_key_checks": "0"
26
+
}
27
+
28
+
- Even though foreign key constraint checks are disabled on target db, table and db creation must happen in a specific order (eg parent should be created
29
+
before child table). This creation order can be specified by passing ``TablesToBeCreatedFirst`` in the config, or else the table creation order will be
30
+
figured out by copydb.
19
31
20
32
Limitations
21
33
-------------
22
34
23
35
- While migrating tables with foreign key constraints the source db should be read_only as there are some fundamental issues when migrating tables with foreign key constraints at the same time when writes are occurring to the source database. This issue descibes briefly why the source database should be read_only during the migration - https://github.com/Shopify/katesql-migration-backend/issues/194.
24
36
25
-
- `Interrupt-Resume functionality` can be used as long as source database is read_only also during the interrupt period
37
+
- ``Interrupt-Resume`` functionality can be used as long as source database is read_only also during the interrupt period
26
38
27
-
- `Inline Verifier` can be used as long as it is ensured that the source database is read_only (even during the interrupt period)
39
+
- ``Inline Verifier`` can be used as long as it is ensured that the source database is read_only (even during the interrupt period)
0 commit comments