johanclasson / vso-agent-tasks

Build and Release Tasks for Visual Studio Online and Team Foundation Server
MIT License
20 stars 16 forks source link

DbUpMigration - Difference in journal scriptfile name #57

Open jorismathijssen opened 5 years ago

jorismathijssen commented 5 years ago

Hello there,

I'm having a problem with this task and manually running DBup. The scriptnames when using subdirectory in dbup is different than the scriptnames used by this task.

Is there a way to solve this? Maybe in the DBup script so they both use '.' or '/'.

Manually running DBup 4.2.0: "1. CreateDB.201901311500_LocationIcon.sql" This task: "1. CreateDB\201901311500_LocationIcon.sql"

You can see the replace happen here: https://github.com/DbUp/DbUp/blob/976d91cd5e4bc7c478f172e91b597dd1495274de/src/dbup-core/Engine/SqlScript.cs#L102

johanclasson commented 5 years ago

The reason for this is that I implemented sub-directory support before it was released in DbUp.

I think that it would be great if I could just switch from \ to ., but that would essentially break everyone's release-pipelines.

Perhaps we could introduce a DirectorySeparatorChar-input parameter and set that to default to \. Then in the next mayor version, we can change that default value to ..

If you would like this to be implemented in a hurry please feel free to send a pull request.

Anyhow, thank you for bringing this to my attention!

jorismathijssen commented 5 years ago

I will take a dive into the code probably tonight