In this example, I check out model 1 from the version manager, edit table-A by dropping several columns (none of them are FK cols or part of the PK).
I rename the model to model 2 and check it in as a version 2.0.
I next activate model 2, and choose “Merge Alter Script”.
Model 2 is on the left, Model 1 is on the right.
After clicking the Execute button, it runs for awhile and then I get a popup that says: “Generated script can produce data loss. Count of warnins : 1. Do you want to processed conversion without check?”
Minor point, but that message needs revised. Is it supposed to say “Do you want to proceed with conversion without check?” Or possibly, “Do you want generation of script to proceed without check?”
The fact that the word “conversion” is there gave me reason to pause. I had to wonder whether clicking Yes was going to cause my datatbase schema to be revised. I believe that the focus is creating the alter script, not converting the schema. Correct?
Anyway, what is the purpose of this dialog. If I click No, I get no alter script.
If I click yes, I do.
Now, question 2:
In my scenario, I dropped a few columns.
The generated alter script never dropped the columns that I dropped.
Here is what it did:
- Dropped all FKs which referenced Table-A
- Created Table-A_4A6A139BF60F471CA78E26F79
- Inserted all rows into that table from Table-A
- Dropped Table-A
- Altered the table created in (2), and renamed it to Table-A
- Added the PK
- Added all the column comments
- Added the FKs which it dropped in (1)
So what I end up with is Table-A exactly as it was before with no changes. The columns that I dropped did not get dropped by the alter script.
I believe the previous beta version that I used did not have this problem.
I’m not sure why it created a new table, populated it, then renamed it. It seems like it was trying to set up for preserving the contents of the dropped columns, which in this case I did not care to retain anyway.
Not sure what the intention here is, but in this case I just wanted to drop the columns.