Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Talk:EclipseLink/DesignDocs/368365

Constraints

What about foreign key and unique constraints? If a foreign is the column that is added, will the foreign key constraint also be added? What if the column is unique, will a unique constraint be defined. Also indexes.

James.sutherland.oracle.com 14:27, 16 January 2012 (UTC)

It would be nice to also have an option to use the JDBC meta-data to drop constraints to allow tables to be dropped/replaced if the previous schema was different.

James.sutherland.oracle.com 14:27, 16 January 2012 (UTC)


Unique + not-null constraints are added during field creation, just as they are during table creation. Foreign key constraints are handled the same as they are for DDL create - all fk constraints are added after the table alter/create process is run. There is no mechanism to see if a constraint has already been added, so all constraints are added, just like in create DDL. Sequences are also either created or ignored. Indexes are the product of postCreateObject on the TableDefinition which is only called when the table is first created. As looking for existing database objects outside of the table is outside the scope of this feature for the time being, they should be looked at being added/handled the same way as constraints currently are instead, otherwise new indexes cannot get added. --Christopher.delahunt.oracle.com 17:54, 16 January 2012 (UTC)

Removed Columns

Why is adding columns supported but not removing? Removing should also be supported as this feature will primarily be used by users during development to keep their database in synch with their model. If we are worried about drop unmapped columns used by other applications, then the option that only adds columns should not be call "create-or-alter-tables" as when we add support for removal it will not be able to use this name. "create-or-extend-tables" perhaps, and reserve "create-or-alter-tables" for the option that removes columns.

James.sutherland.oracle.com 13:22, 17 January 2012 (UTC)

Back to the top