SQLEditor: Merging documents
Although SQLEditor doesn’t include a facility to merge documents directly, you can achieve this task by using copy and paste.
See also: SQLEditor: Copy and Paste, foreign keys which covers how SQLEditor behaves when you copy and paste foreign keys.
The main problem is what happens when a table in document A has the same name as a table in document B.
Possible Cases
I have two documents that have no conflicting tables
This is the simplest case, simply select all of the objects, choose Edit->copy and then Edit->Paste into the new document
I have some conflicting tables, but I don’t need relationships between objects in different documents
Use the same method, but note that conflicting tables will be renamed.
I have some conflicting tables and I need to have tables referencing between different documents
This is the most complicated case, an example might be where two people are working on a database and there is a single main table that both reference from their own areas.
The easiest way to do this is to use SQLEditor’s reconnection on paste system.
We’re going to merge Document B into Document A.
In this example a single tables, Table2, is shared between both documents and linked to by different objects in each.
Document A:
Document B:
We look at any shared objects to make sure that they have all of the fields that are necessary. In this case note that Table2 is shared between A and B and has the correct id column in both versions.
Now we copy Table1 only. (Table2 is already present in Document A).
Document A afterwards:
Isn’t this very complicated? Make it simpler!
Yes it is complicated. (Sorry!)
Proper merging is high on the feature request list and is something that is being actively looked at.
I want to drag instead of using the clipboard
As an alternative to copy/paste you can also drag with the option or alt key held down.
This works otherwise in exactly the same way