changing cardinality in an operational model

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

changing cardinality in an operational model

Ivo Clemens
Hi,

I implemented a model, and loaded data into the tables. Now I realise that I made a mistake in the cardinality of a tie. Instead of 1 to many, it should be a many to many tie.
I can change this easily enough in the model, by toggling the identifier. After changing the model, I generate the SQL to implement the change in the database. But the SQL for this tie-table starts with IF NOT EXISTS. So even if I execute the sql from the altered model, this change will not be implemented in the database.

Should I manually update the key-setting for this table?
Is it possible to get the tool to write SQL that will implement this kind of change?

Cheers,
Ivo
Reply | Threaded
Open this post in threaded view
|

Re: changing cardinality in an operational model

roenbaeck
Administrator
We have only begun to look at handling alter table statements when a situation like yours occurs. The workaround we have adopted until this is in place is to:

1) rename the tie table in the database
2) run the script so the new tie will be created
3) migrate data from the renamed tie to the newly created one

I believe this is quite acceptable in the hopefully rare cases when it's needed, which is why the alter table logic has been given low priority.