Skip to content

Commit

Permalink
Working on creating a generator for the migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Jul 26, 2009
1 parent 8fc4bf8 commit 8d90537
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Gemstub.gem_spec do |s|
s.version = "0.1.1"
s.rubyforge_project = "magrathea"
s.add_dependency('configatron')
s.email = 'mark@markbates.com'
s.homepage = 'http://www.metabates.com'
end

Gemstub.rdoc do |rd|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateApnDevices < ActiveRecord::Migratio # :nodoc:
class CreateApnDevices < ActiveRecord::Migration # :nodoc:
def self.up
create_table :apn_devices do |t|
t.text :token, :size => 71, :null => false
Expand Down
11 changes: 11 additions & 0 deletions lib/apn_on_rails/generators/apn_migrations_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'rails_generator'
class ApnMigrationsGenerator < Rails::Generator::Base
def manifest
record do |m|
# m.template "rebba_tasks.rake", "lib/tasks/rebba_tasks.rake", :collision => :force
#{fixtures}
#{mts}

end
end
end
16 changes: 11 additions & 5 deletions lib/apn_on_rails/tasks/db.rake
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
namespace :apn do

namespace :db do

desc 'Runs the migrations for apn_on_rails.'
task :migrate => [:environment] do
puts File.join(File.dirname(__FILE__), '..', '..', 'apn_on_rails', 'db', 'migrate')
ActiveRecord::Migrator.up(File.join(File.dirname(__FILE__), '..', '..', 'apn_on_rails', 'db', 'migrate'))

task :migrate do
puts %{
This task no longer exists. Please generate the migrations like this:
$ ruby script/generate apn_migrations
Then just run the migrations like you would normally:
$ rake db:migrate
}.strip
end

end # db
Expand Down

0 comments on commit 8d90537

Please sign in to comment.