I implemented my own migration code for my Racket application and I am
personally happy with it.  It can only upgrade (from old to new) and not
downgrade a database, however it supports showing a GUI progress dialog for
the migration process (one step for each SQL statement applied).  Not sure 
how
it compares to Rails, as I don't know anything about Rails.  Database 
upgrade
works as follows:

* the database contains a SCHEMA_VERSION table with a single row containing 
a
  number (which is the schema version)

* SQL database migration code is written to upgrade from one version to the
  next, one file per migration

* when a database is opened, the racket code will check the schema version,
  determine which SQL scripts to run and runs these scripts.

This method has worked well for upgrading through 30 database versions so 
far
-- each individual upgrade can contain multiple SQL statements (e.g create
table, or index, etc).  The application itself however will only upgrade the
last 12 versions, mainly because this is the point when I added an automated
test for the database upgrade to my build.

If you want to have a look, the SQL schema and migration code is here:
https://github.com/alex-hhh/ActivityLog2/tree/master/sql and the code that
handles database migration (among other things) is here:
https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/dbapp.rkt

Best Regards,
Alex.

On Thursday, November 22, 2018 at 6:18:08 AM UTC+8, P. Baillet wrote:
>
> Hi list,
>
> I've been playing with Racquel a bit and I've been wondering if any of you 
> know/use some kind of migration framework to run DB migrations on databases.
>
> I'd looking for something that gives the same UX as when using Rails to 
> manage migrations:
>
> - instrument the DB internals to keep track of the latest applied migration
> - batch apply up/down migrations written in Racket
> - use gen-data-class to generate the whole SQL schema on disk
>
> Of course, I'd prefer to stick to Racket-lang! 
>
> Thank you for your feedback,
> -- 
> Pierre.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to