exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 69 discussion

Actual exam question from Microsoft's 70-487
Question #: 69
Topic #: 1
[All 70-487 Questions]

DRAG DROP -
You are developing an ASP.NET Core MVC web application. The application will use Entity Framework Core and a SQLite database.
You rename a property in the Customer data model. You attempt to apply the migration to the SQLite database and receive a NotSupportedException error that includes a table named Customer.
You need to resolve the migration error.
Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
The SQLite provider has a number of migrations limitations. You can workaround some of these limitations by manually writing code in your migrations to perform a table rebuild. A table rebuild involves renaming the existing table, creating a new table, copying data to the new table, and dropping the old table.
References:
https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
zimzimzimma
Highly Voted 4 years, 3 months ago
In my opinion the given answers are correct. 1. rename the existing customer table (from Customer to Customer2) 2. create new customer table (create Customer table) 3. copy data from existing customer table to new customer table (copy from Customer2 to Customer) 4. drop the existing customer table (drop Customer2)
upvoted 13 times
Jobair
4 years, 2 months ago
the initial rename of the table to a temporary name might corrupt references to that table in triggers, views, and foreign key constraints. Create new table, Copy data, Drop old table, Rename new into old https://sqlite.org/lang_altertable.html#otheralter
upvoted 1 times
gokhan
4 years, 1 month ago
where is the "Rename new into old"?
upvoted 3 times
...
...
...
mr_
Highly Voted 4 years, 5 months ago
In my opinion the correct answer proposal is wrong. Correct answer should be: 1. Create new table. 2. Copy data. 3. Drop old table. 4. Rename new table into old. Quote (MS): 'Table rebuilds involve creating a new table, copying data to the new table, dropping the old table, renaming the new table.' The same recommendation you can find on official SQLite.org docs. Refs: * https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations * https://sqlite.org/lang_altertable.html#otheralter
upvoted 6 times
klassanov
4 years, 3 months ago
Great, thanks!
upvoted 1 times
...
zimzimzimma
4 years, 3 months ago
The problem I'm having with your answer is that you are changing the text of the options you can choose from. If you do not change that, by your logic it's 1. Create new customer table (eg Customer2) 2. copy data from existing customer table to new customer table (eg from Customer to Customer2) 3. drop the existing customer table (drop Customer table) 4. rename the existing customer table (rename what? you just dropped it) I think the given answers are correct: 1. rename the existing customer table (from Customer to Customer2) 2. create new customer table (create Customer table) 3. copy data from existing customer table to new customer table (copy from Customer2 to Customer) 4. drop the existing customer table (drop Customer2)
upvoted 11 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago