First, let me elaborate on why it isn’t possible to customize some of the system functions anymore (for example the Oracle 10g generation). We are currently in the process of rewriting many of TDM functions in Delphi. Rewritten functions are not customizable any more in in the way you are used to, but they are significantly faster. The Oracle generation functions are rewritten already in 5.3, that’s why you weren’t able to find them in Package/Script Explorer.
To answer your questions:
I looked at the package but what you have done is not documented anywhere
It’s a process that isn’t fully documented because most TDM users won’t probably ever need this and there also exists the danger of doing something wrong and blocking some of the TDM functions, if not the whole application. But basically in the package we used Metamodel where we configured your customized function (CreateAttrTrigSequences()) to be used instead of the default TDM function.
There is some information on Metamodels in TDM Help (Projects and Models > Scripting and Customization > Metamodel) but it doesn’t really go deep. There is also an interesting article on the Wiki which is related to the topic and describes how TDM allows you to add your own functionality by using your own packages - that is the process we used in your case.
How can I maintain the same order of generation indices foreign key. Before the index was created just before the foreign key while now just after the creation of the table.
This needs some explanation as well. In TDM 5.1, the foreign key indices were created just before the foreign keys themselves, but only during the generation of DDL script (the indices didn’t exist in the model). This caused some trouble in the long run so starting with TDM 5.2 the FK indexes are by default created after creating a table they belong to, just like other indexes (they are now part of the model).
In Model Menu > Order of Generated Objects > Extension Tab you can set if the indexes will be created after each table, or all at once after all tables are created. If you’d like to create them just before FKs, feel free to submit the idea to the Idea Pond and we will consider implementing it.
How find a FKIndex from FK in macro script?
You can test a relationship and see, if it there are any FK indices associated with it by doing the following:
FKIndex = Relation.ForeignIndex // If the relation has no FK index associated with it, FKInxed will be NULL
Or, if you want to know if an index is a FK index, try this:
Relation = Index.RelationSource;
if (Relation != null)
Log.Information("Index is FKIndex for relationship: " + Relation.Name);
Hopefully this wall of text will help you