phoenixwebgroup / DotNetMongoMigrations

Migrations for Mongo using the official csharp (dotnet) driver
Other
59 stars 34 forks source link

Why do you use custom version type? #4

Open dtretyakov opened 10 years ago

dtretyakov commented 10 years ago

Hi, in FCL exists Version class: http://msdn.microsoft.com/en-us/library/system.version.aspx Could you explain why do use use custom MigrationVersion type?

ryanohs commented 10 years ago

I agree that the FCL Version class looks like a good substitute. Perhaps @g0t4 was avoiding using a sealed class, but he probably just didn't know about the Version class.

g0t4 commented 10 years ago

Is there something that MigrationVersion doesn't do that you need it to?

On Wed, Apr 16, 2014 at 11:20 AM, Ryan Ohs notifications@github.com wrote:

I agree that the FCL Version class looks like a good substitute. Perhaps @g0t4 https://github.com/g0t4 was avoiding using a sealed class, but he probably just didn't know about the Version class.

— Reply to this email directly or view it on GitHubhttps://github.com/phoenixwebgroup/DotNetMongoMigrations/issues/4#issuecomment-40633514 .

dtretyakov commented 10 years ago

I've made some changes in the following pull request: https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/5

And while looking through project I found that exists MigrationVersion class with a custom BSON serializer. After replacing of it by Version class nothing has changes, so It was interesting for me for a which purposes it was used.

May be after review of this changes you can publish a new version in the nuget?

g0t4 commented 10 years ago

Can we split these out into separate commits, changing Version isn't a necessity at this point and requires further thinking/testing and I don't see any value out of the conversion at this point

On Wed, Apr 16, 2014 at 11:50 AM, Dmitry Tretyakov <notifications@github.com

wrote:

I've made some changes in the following pull request: #5https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/5

And while looking through project I found that exists MigrationVersionclass with a custom BSON serializer. After replacing of it by Version class nothing has changes, so It was interesting for me for a which purposes it was used.

May be after review of this changes you can publish a new version in the nuget?

— Reply to this email directly or view it on GitHubhttps://github.com/phoenixwebgroup/DotNetMongoMigrations/issues/4#issuecomment-40637081 .

dtretyakov commented 10 years ago

Our concern: MigrationVersion provides ability to use up to 3 version numbers, but we're using all of 4 numbers, which available in the Version class.

I'll split pull request in two parts. If you worry about backward compatibility then both of CollectionMigration and Migration classes accept version numbers as a string:

dtretyakov commented 10 years ago

So you can look at the following:

g0t4 commented 10 years ago

Awesome, that seems reasonable to me for 4 numbers

On Wed, Apr 16, 2014 at 12:41 PM, Dmitry Tretyakov <notifications@github.com

wrote:

So you can look at the following:

  • Upgrade to mongodb c# driver v1.9: #5https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/5
  • Replaced MigrationVersion by Version: #6https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/6

— Reply to this email directly or view it on GitHubhttps://github.com/phoenixwebgroup/DotNetMongoMigrations/issues/4#issuecomment-40642883 .

g0t4 commented 10 years ago

And FWIW I think this library's approach to migrations was a good starting point, but it was based too much on the process of doing SQL migrations and too coupled to .net (for no real reason)... going forward I will be working on something that leverages mongo shell scripts in an organized fashion, no reason to couple to the c# driver long term

On Wed, Apr 16, 2014 at 1:38 PM, Wes McClure wes.mcclure@gmail.com wrote:

Awesome, that seems reasonable to me for 4 numbers

On Wed, Apr 16, 2014 at 12:41 PM, Dmitry Tretyakov < notifications@github.com> wrote:

So you can look at the following:

  • Upgrade to mongodb c# driver v1.9: #5https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/5
  • Replaced MigrationVersion by Version: #6https://github.com/phoenixwebgroup/DotNetMongoMigrations/pull/6

— Reply to this email directly or view it on GitHubhttps://github.com/phoenixwebgroup/DotNetMongoMigrations/issues/4#issuecomment-40642883 .

dtretyakov commented 10 years ago

Great, we're looking forward to look at the new migration toolkit.

g0t4 commented 10 years ago

Hey I'm just curious, what do you use 4 numbers for that can't be accomplished with 3?

dtretyakov commented 10 years ago

We're using migration version associated with a complete product version.