Code-first migration is not recognising column drop - asp.net-mvc

I have 2 projects (one called Biz and the other WebAdmin which is the startup project).
I delete a property from the biz project model and call add-migration. It creates the migration CS in WebAdmin but doesn't create anything for biz project changes.
I add in a dropcolumn statement by hand DropColumn("Account", "TestID") but this doesn't not get applied to the model that 'biz' is referencing.
How can I get the dropcolumn to work?

Ensure you select the right project target in the Package Manager console.

Related

work item migration, but custom fields where not available on the target environment

we started the worktime migration from DEVOP to other DEVOPS
but we forget to create the board columns and a custom field Stakeholder (identity)
So, we created and did run the migration tool again, but it did not set that stakeholder field.
how can this be corrected?
also the assignment to the board column did not get corrected
we rerun it again, but it did not update those fields
By default, any fields that exist with the same name on the Source will be automatically mapped to the Target. If there is a difference you will need to map the fields.
https://nkdagility.github.io/azure-devops-migration-tools/Reference/

Tfs project creation results in error: TF400930: Field 'System.ExternalLinkCount' is defined multiple times

I have recently upgraded an on-premises Team Foundation Server from Tfs 2015 to Tfs2015.Update3 (14.102.25423.0)
The upgrade was completed and all other functionality seems to work as usual.
A day or so ago I attempted to create a new Tfs project (TFVC) and that resulted in an error.
When I look at the application tier log files, I see the following:
[10:31:30.153] Executing step: Create the Team Project.
[10:31:30.167] Executing step: 'Create the Team Project.' WorkItemTracking.CreateTeamProject (4 of 13)
[10:31:30.183] Getting process template.
[10:31:31.463] Refreshing server caches.
[10:31:31.463] Importing work item link types.
[10:31:32.180] Importing work item types
[10:31:33.727] Importing work item types
[10:31:34.413] [Error] TF400930: Field 'System.ExternalLinkCount' is defined multiple times with different field definitions. Correct the field definition and try again.
[10:31:34.507] Microsoft.TeamFoundation.WorkItemTracking.Server.LegacyValidationException: TF400930: Field 'System.ExternalLinkCount' is defined multiple times with different field definitions. Correct the field definition and try again.
[10:31:34.507] at Microsoft.TeamFoundation.WorkItemTracking.Server.ProvisioningService.InternalImportWorkItemTypesOrGlobalWorkflows(IVssRequestContext requestContext, Int32 projectId, String methodologyName, IEnumerable`1 typeElements, ProvisioningActionType actionType, InternalSchemaType schemaType, Boolean overwrite, ProvisioningImportEventsCallback importEventCallback)
We are unfortunately making use of a customized template (which is based on the Scrum template) and it is exactly this template that causes the error.
When creating a new Tfs project (TFVC) based on the standard Scrum or Agile templates it works fine.
I downloaded the customized scrum template in question and did a grep search on “System.ExternalLinkCount”.
When I look at the fields they do seem to be of the same type.
Any ideas or suggestion why it is acting up in this way?
You can just remove the field definition from these work items, it's a standard field which will be added to all your work item types automatically.

Updating TFS field names in more than 1 Team Project Collection

I have two Team Project Collections -- DefaultCollection and ArchiveCollection. I need to update the display name for System.ExternalLinkCount from 'ExternalLinkCount' to 'External Link Count'.
This is the command I'm using to accomplish that on both collections:
witadmin changefield /collection:http://localhost:8080/tfs/<CollectionName> /n:System.ExternalLinkCount /name:"External Link Count"
I get no errors from the command and it tells me that the field is updated. However, after I process the Tfs Warehouse, I see a schema conflict on the field. The DefaultCollection has the updated name, but the ArchiveCollection still has the old name.
That's the part I don't understand. The update is getting made to the same field in both collections, but it isn't updating in the ArchiveCollection.
Not sure what I'm missing.

Can not create a new Model version

I have an old project (made for iOS4).
I am upgrading it now and try to add a model version to my Core Data model.
When I am trying to add the version from Xcode menu, it simply create a new version of the model and does not create the .modeld package.
I tried to change it manually but it douses many problems and the migration fails.
Why it won't let me create the .modeld file ?
Any idea how can I overcome this problem ?
Here is the image from Xcode navigator -
While it should be -
Thanks a lot
Xcode will always create a .xcdatamodel file for new model
versions. .xcdatamodeld is a file package that groups versions
of the model.
There's a workaround that you can do:
Create a new Data Model (File > New > File... > Core Data > Data Model) and give the model the same name as your current version (e.g. jerusalemBiblicalZoo).
Reveal the created jerusalemBiblicalZoo.xcdatamodeld on Finder
Right click on the file and select Show Package Contents so you will see a .xcdatamodel file there.
Override it with your old .xcdatamodel file. Then you will have the new data model structure using your old single model version.
if you want to create new version for coreData, don't recreate xcdatamodel.Click jerusalemBiblicalZoo.xcdatamodel and go to Editor->Add Model Version select base model and go on.

What doctrine schema handler tools is out there better than mysql-workbench-doctrine-plugin?

I am using mysql-workbench-doctrine-plugin and it is definitely something which is very useful! However I need something more robust which can handle more exceptional cases! The current plug in has some issues like:
Generates duplicate relationship name. For example if one table has two separate column having relationship with another particular table, then it will generate same name for the relationship (model class name of that particular table)
foreingAlias name: if the table name is user_phonenumber then foreign alias would be userPhonenumber, but it is better to have it like UserPhonenumber as it will look better to call like getUserPhonenumber than getuserPhonenumber. However this can be changed by tweaking the DoctrineExport.grt.lua file of the plugin..
if sfGuard plugin is used then all the sfDoctrineGuard related model classes are generated like SfDoctrineGuard* which breaks the plugin as it uses smaller 'sf' not 'Sf' as the name. (this is not a big issue as it is an exception for this plugin) .
What is the situation now is that I need to tweak a lot whenever I make changes to my database design in the workbench and generate yml for doctrine from it. I need something more powerful so that I need less tweaking to work seamlessly back and forth as project grows and evolves! Any suggestion ? Or what do you do when your database is big and changes a lot?
I've been using ORM Designer with great success. Its quirky with Doctrine 2, but it generates the entities for you with proper ORM relationships
http://www.orm-designer.com/

Resources