I haven't tried to write something similiar in other db adapters but I think it should be possible.graeme defty, functions init/0 and reinit/0 seems to be quite good solution to initliaze database.
What I really miss in CB are migrations and schema available in Ruby on Rails. I think that it would be nice to develop something similiar.
Kai Janson, I agree that migration files in RoR is a mess but in long-term development it's a nice way to make some changes with database.
El Tuesday 13 September 2011 09:30:03 escribió:
> > If we were to do migrations it would go something like this. DB tables
> > would be versioned (e.g. voters_v123) and the ID would contain the
> > version number (as it already contains the model name... e.g.
> > "voter-1-v123"). Models would have migration functions, e.g.
> >
> > migrate(v123, v124, OldAttributes) ->
> >
> > NewAttributes;
sounds good! i have used RoR migrations a lot, in little and big projects, and
really, is a mess. We don't get a real order, and a fast view of tables, and
database structure (or schema).
But, the proposal, it could be:
- schema/
- my_connection/ (by example PostgreSQL)
- my_table/
- 1.erl (.yml, ...)
- 2.erl
- 3.erl
- ... and so on
- my_other_table/
- 1.erl
- my_other_connection/ (by example Riak, is possible?)
- ...
Have a module to "update", "redo" a specific version, "downgrade" to a
specific version and "status" (to see the general table and database status).
About table, to migrations, should be a table by connection, and contents a
field with "table -> version" pair of values.
I could help you to do it (if is a good idea for all).
Regards!
--
Manuel A. Rubio "Bombadil"
Usuario de GNU/Linux #323628 acorde a http://counter.li.org/
Técnico en Admin. Sistemas Informáticos
2011/9/13 Przemysław Dąbek <przemysl...@gmail.com>:
It could be sorter in integer way and, in this form, the three options are
valid, isn't?
About table, to migrations, should be a table by connection, and contents a
field with "table -> version" pair of values.
I could help you to do it (if is a good idea for all).
Regards!
--
Manuel A. Rubio "Bombadil"
Usuario de GNU/Linux #323628 acorde a http://counter.li.org/
Técnico en Admin. Sistemas Informáticos
These files will perform general DB tasks. Each file, will contents a simil to
a SQL instruction (or equivalent for another kind of databases as NoSQL if
necessary).