Sha256: 617a984a42411718435d1b682201ffce979322fb967c2469340ef3a57bc2d039

Contents?: true

Size: 876 Bytes

Versions: 1

Compression:

Stored size: 876 Bytes

Contents

require_relative 'db_modifier'

namespace :ez do

  desc "Reset the database scheme from scratch."
  task :reset_tables => ['db:drop', :tables] do
  end

  desc "Automatically update the database schema and model files."
  task :tables => :environment do
    if File.exists?('db/models.yml')
      db = DbModifier.new
      db.migrate
    else
      puts "To get started, edit the db/models.yml file to describe your table schema."
      File.open("db/models.yml", "w") do |f|
        f.puts <<-EOS
# Example table for a typical Book model.
#
# Book:
#   - title: string
#   - price: integer
#   - author: string
#   - summary: text
#   - hardcover: boolean
#
# Follow the syntax exactly (colons and spacing are important).
# Column type choices are: string, text, integer, and boolean.
# You can have as many models as you want in this file.
EOS
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ez-0.0.1 lib/tasks/ez_tasks.rake