4

Assume that I have existing database with existing data.

Is there any framework / ORM that generates data conversion SQL scripts when I need change column datatype? Of course there is problem with conversions like

  • float to int
  • string to int

, but I would like to have such default functionality that automatically converts data from

  • int to float
  • int to string.

Do I have always to write data SQL data conversion scripts in both cases?

Michał Kuliński
  • 1,928
  • 3
  • 27
  • 51
  • #sigh# What languages are you working with? To my knowledge, there isn't any _one_ ORM that works with multiple languages 'as is' (barring being able to wrap external libraries...). A number of them will simply 'convert' data into the desired native types, if they've been mapped that way, and that it's safe to do so. Otherwise, they provide a number of facilities for the translation before/after persistence. – Clockwork-Muse Dec 05 '12 at 16:59
  • @Clockwork-Muse, It could be any language. – Michał Kuliński Dec 07 '12 at 08:07

6 Answers6

3

In the .Net world I've had very good experience with LLBLGen Pro. It supports the generation of DDL scripts to migrate the underlying database to the updated entity definitions. Here is quick start guide that shows the overview of how this works, and here is documentation section for Model-First design process

You can either use it with its own runtime framework, or simply as a design tool for Entity Framework, NHibernate, or Linq to SQL.

explunit
  • 18,967
  • 6
  • 69
  • 94
3

SauceDB is written in .NET and is capable of doing automatic schema modifications when you change the data type on an access object.

http://sauce.codeplex.com

Disclamer: I wrote it

iamkrillin
  • 6,798
  • 1
  • 24
  • 51
2

There is EntityFramework.Migrations for example.

Michał Kuliński
  • 1,928
  • 3
  • 27
  • 51
  • If it's the entity framework, and working with NuGet, then the implication is that it's a CLR library at minimum (and may be language specific even then, probably C#). If you're in a java-only environment, this most likely won't work for you. What application-side language are you working with? – Clockwork-Muse Dec 07 '12 at 16:54
  • Technology / application-side language doesn't matter. I'm asking in general. If I would find proper solution I will change technology / language. – Michał Kuliński Dec 11 '12 at 13:27
2

And another competitor: Propel Migrations

Michał Kuliński
  • 1,928
  • 3
  • 27
  • 51
1

What about Doctrine Migrations

Michał Kuliński
  • 1,928
  • 3
  • 27
  • 51
1

I would recommend DataObjects.Net.

Automatic upgrade works when we add new classes and properties to the model, but sometimes necessary to perform some specific schema modifications, for example rename of properties or classes, in this case you can write an upgrade handler(RenameFieldHint, RemoveFieldHint etc)

Sergii
  • 1,320
  • 10
  • 10