Re: Migrating Tables with Relations Between Structures

2017-04-06 Thread Peter Jakobsson via 4D_Tech

Many thanks Miyako !

I’ll look into both of those approaches. Very promising.

Peter

On 6 Apr 2017, at 02:37, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> when you copy multiple tables in the structure editor,
> you get the table as well as the relation.
> 
> pasting it back to the structure editor removes all ancillaries such as 
> indexes and links,
> but the plugin entry-point allows you to re-create them.
> 
> https://github.com/miyako/4d-plugin-structure-access
> 
> the IMPORT STRUCTURE command is also capable of restoring relations, as well 
> as the indexes.
> (the UI does not show bold at first but they are properly set. just re-open 
> the database)
> 
> http://doc.4d.com/4Dv16/4D/16/IMPORT-STRUCTURE.301-3036688.en.html
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Migrating Tables with Relations Between Structures

2017-04-05 Thread Keisuke Miyako via 4D_Tech
when you copy multiple tables in the structure editor,
you get the table as well as the relation.

pasting it back to the structure editor removes all ancillaries such as indexes 
and links,
but the plugin entry-point allows you to re-create them.

https://github.com/miyako/4d-plugin-structure-access

the IMPORT STRUCTURE command is also capable of restoring relations, as well as 
the indexes.
(the UI does not show bold at first but they are properly set. just re-open the 
database)

http://doc.4d.com/4Dv16/4D/16/IMPORT-STRUCTURE.301-3036688.en.html




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Migrating Tables with Relations Between Structures

2017-04-05 Thread John DeSoi via 4D_Tech
Hi Peter,

I have not implemented this, but I'm contemplating it for a component that 
would need to initially create some table structure in the host component. If 
you want to export/import a subset of tables, it seems not too hard to export 
the XML structure and then parse it to create a new XML file with just the 
parts you want. So if I only want 3 tables out of 100, the new XML file would 
just have those three tables and the relations between them.

Not worth it if this is a one off transfer, but it seems like something that 
could be generalized if needed more than once.

John DeSoi, Ph.D.



> On Apr 5, 2017, at 9:07 AM, Peter Jakobsson via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Thanks for that suggestion.
> 
> I tried that but in a complex structure it’s quite a footery and unsystematic 
> process. You’ve got to identify tag blocks indirectly by UUID and so on and I 
> found it didn’t save much time over just redrawing the relations manually. It 
> probably works better when you’re transferring an entire structure rather 
> than having to fish out the stuff you want from a superset.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Migrating Tables with Relations Between Structures

2017-04-05 Thread Peter Jakobsson via 4D_Tech
Hi John

Thanks for that suggestion.

I tried that but in a complex structure it’s quite a footery and unsystematic 
process. You’ve got to identify tag blocks indirectly by UUID and so on and I 
found it didn’t save much time over just redrawing the relations manually. It 
probably works better when you’re transferring an entire structure rather than 
having to fish out the stuff you want from a superset.

Peter

On 5 Apr 2017, at 14:41, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote:

> You could export the XML structure definition and then edit it to only 
> include the tables and relations you want. Then import it into the target 
> structure.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Migrating Tables with Relations Between Structures

2017-04-05 Thread John DeSoi via 4D_Tech
You could export the XML structure definition and then edit it to only include 
the tables and relations you want. Then import it into the target structure.

John DeSoi, Ph.D.



> On Apr 5, 2017, at 5:34 AM, Peter Jakobsson via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Let’s say you have a group of tables with complex relations. You want to copy 
> them from one structure to another as a coherent block, retaining the 
> relations.
> 
> What’s the best way ?
> 
> - drag drop between the two respective explorers in design mode
> - copy & paste from the structure editor
> - export SQL definition
> - some other way ?

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Migrating Tables with Relations Between Structures

2017-04-05 Thread Peter Jakobsson via 4D_Tech
Hi

I visited this subject a few years ago and was wondering what people prefer to 
do in this situation.

Let’s say you have a group of tables with complex relations. You want to copy 
them from one structure to another as a coherent block, retaining the relations.

What’s the best way ?

 - drag drop between the two respective explorers in design mode
 - copy & paste from the structure editor
 - export SQL definition
 - some other way ?

Many thanks in advance for any interesting commentary ! Right now I’m just 
drag-dropping and rebuilding the relations manually.

Regards

Peter

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**