Description: Sometimes when either doing a Forward Engineering, or during Complete Compare | Alter Script, we get this message 'No Schema to Generate' and no script is created. Why so? And how can we 'fix' it?
Solution: In erwin DM, since 9.x, Forward Engineering is working at Subject Area (SA) level. This means that the syntax creation is focused on the current SA one is in. So, even if a Table, or View is in the Model or in any other SA, but not in the current SA the syntax for that will not be included in the script created. An example could be that a Table or a View is created in the model or in a SA, and user then switches to another SA and invokes Forward Engineering | Alter Script menu to generate the syntax for that newly added object. In this case they will get this message 'No Schema to Generate' because that object is the only change and is also not in that SA. To see the syntax in Preview simply switch back to the SA where new object was added in.
Another place where this can impact is during Complete Compare where the differences are visible at the model level and an object (or objects) is/are either imported or exported. If those objects are not in the current SA when Complete Compare was initiated, we will still see the same message. The remedy is to be in the same Subject Area with the objects being imported into. One suggestion could be to create a Subject Area with Auto-Populate selected so it has ALL objects in that. There is no need to create any Diagram under that SA as that is what impacts the size of the model more noticeably. Once you have that SA, switch to that when initiating the Complete Compare. Since Auto-Populate is selected for that SA, when an object is imported to that model, it is also automatically added to that SA and the syntax is created as expected. Please note that in Complete Compare when one imports an object to a model, it is added at the Model level and not in any SA unless that SA has Auto-Populate selected in its properties. Since the Subject Area are generally created for selected objects for specific criteria, Auto-Populate is usually not selected, hence the suggestion to create a separate SA for this.