Toad World® Forums

Generate Change Script


#1

Hi,

Sorry if this is a “supid-noob” question but …

(Version 5.4.6.12)

I did a reverse engineer of an Oracle 11gr2 schema and after it was complete did a ‘Generate Change Script’ comparing the newly created model with the same schema I just reverse-engineered. I wasn’t expecting any differences but it generated “ALTER TABLE xxx MODIFY (xxx_pk_col NOT NULL)” for the primary key columns.

Is this something I did wrong with the reverse-engineer or something I did wrong with the “Generate Change Script”?

How do I prevent this from happening? We have a standard where we don’t create explicit NN constraints on our PK columns so I really don’t want the “Generate Change Script” to raise this false-positive.

Thanks,

Steve


#2

Hello Steve,

Try going to Settings Menu | Options | Physical Model | General tab and enable Allow Null Attributes in Keys option. This should prevent the change script generator from creating NN constraints.

Regards,

Lukas.


#3

Thank you very much Lukas. That resolved the problem but raised another one.

When I did the reverse engineer I unchecked “Physical Attributes and Tablespace storage…” and “Index Attributes (Physical Attributes…”. When I then did the Generate Change Script, I was getting differences on the physical attributes of the tables and keys. The only way I could find to silence those differences was to into the ‘Detailed Settings’ on ‘Select Object Types and Properties’ and uncheck Entities.Physical Properties and Entities.Keys.Using Index Properties. Is there any way to make these changes along with any changes I make in the ‘DDL Code Generation’ step ‘permanent’ so that I don’t need to remember to do it each time I generate a change script? Maybe save it along with the model?

The other thing I was wondering was if there was a way to suppress the reverse engineering of all users. I ran the reverse engineer as a DBA user and it ended up reverse engineering every user in the database. I couldn’t see a way to turn that off.

Thanks again,

Steve


#4

Hello again Steve,

The differences make sense, since you haven’t reverse engineered all the properties which are used in the database. Anyway, you can either save the item selection in Detailed Settings (see this page), or you can save the change script generation process as an Action Definition and reuse it in Model Actions.

As for reverse engineering all users, you can try unchecking “All Database Users, Roles and Permissions” option in Reverse Engineering Wizard | Options dialog.

Regards,

Lukas