Project

portugal

0.0
No commit activity in last 3 years
No release in over 3 years
ActiveRecord migrations without Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 3.0.0
>= 0
 Project Readme

Portugal

Use ActiveRecord migrations, but not in Rails.

Installation

Add this line to your application's Gemfile:

gem 'portugal'

And then execute:

$ bundle install

Usage

In your Rakefile:

require 'portugal/tasks'
Portugal.configure do |config|
  config.migrations_path = File.expand_path("../config/migrations", __FILE__)
end

# This task is called before Portugal executes its tasks.
# It should require ActiveRecord somehow and establish the database connection
#
# Change it so it works for your application
task :environment do
  require 'bundler'
  Bundler.require
  ActiveRecord::Base.establish_connection({})
end

Then, in your shell:

$ bundle exec rake -T | grep 'db:'
rake db:migrate        # Migrate the database
rake db:new_migration  # Create a new migration file (specify name w/ NAME=do_something)
rake db:rollback       # Rolls the database back to the previous version (specify steps w/ STEP=n).

Yay!

Inspiration

Gob: Portugal? Well, gonna live it up in ol’ South America, aren’t we, Michael?