Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequel generate migration

Tags:

ruby

sequel

I see that the Sequel gem supports migrations here, but I don't see any type of generator documented. Does one exist; or should I be manually creating all of my migrations (or alternately creating my own task to generate migrations)?

like image 218
bigtunacan Avatar asked Apr 02 '14 01:04

bigtunacan


1 Answers

From the documentation:

Sequel doesn't come with generators that create migrations for you. However, creating a migration is as simple as creating a file with the appropriate filename in your migrations directory that contains a Sequel.migration call.

The contents of the migration file doesn't have to specify a timestamp or index and it's an extremely simple format.

I generally just copy a previous migration (maybe one similar to the migration I'm creating) and alter the filename. See existing migrations with:

$ ls -1 db/migrate/
20170320075430_check_postgres_extensions.rb
...

For running migrations, I use the rake task that's available here.

like image 94
pnomolos Avatar answered Oct 27 '22 23:10

pnomolos