From 5a8871f02f29f8267d605aa11416cc09fc440e41 Mon Sep 17 00:00:00 2001 From: cowboycoded Date: Sat, 12 Feb 2011 08:10:45 -0500 Subject: [PATCH] untrack schema and any new migrations in test_app --- .gitignore | 2 + test_app/Gemfile.lock | 2 +- ...20110212032114_create_impressions_table.rb | 27 ----------- test_app/db/schema.rb | 45 ------------------- test_app/spec/generators_spec.rb | 18 -------- 5 files changed, 3 insertions(+), 91 deletions(-) delete mode 100644 test_app/db/migrate/20110212032114_create_impressions_table.rb delete mode 100644 test_app/db/schema.rb delete mode 100644 test_app/spec/generators_spec.rb diff --git a/.gitignore b/.gitignore index b844b14..470ee96 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ Gemfile.lock +/test_app/db/migrate/20 +/test_app/db/schema.rb diff --git a/test_app/Gemfile.lock b/test_app/Gemfile.lock index 59b0e5d..0665b43 100644 --- a/test_app/Gemfile.lock +++ b/test_app/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /rails_plugins/mine/impressionist specs: - impressionist (0.2.0) + impressionist (0.2.1) GEM remote: http://rubygems.org/ diff --git a/test_app/db/migrate/20110212032114_create_impressions_table.rb b/test_app/db/migrate/20110212032114_create_impressions_table.rb deleted file mode 100644 index 751b536..0000000 --- a/test_app/db/migrate/20110212032114_create_impressions_table.rb +++ /dev/null @@ -1,27 +0,0 @@ -class CreateImpressionsTable < ActiveRecord::Migration - def self.up - create_table :impressions, :force => true do |t| - t.string :impressionable_type - t.integer :impressionable_id - t.integer :user_id - t.string :controller_name - t.string :action_name - t.string :view_name - t.string :request_hash - t.string :ip_address - t.string :message - t.timestamps - end - add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash, :ip_address], :name => "poly_index", :unique => false - add_index :impressions, [:controller_name,:action_name,:request_hash,:ip_address], :name => "controlleraction_index", :unique => false - add_index :impressions, :user_id - end - - def self.down - remove_index :impressions, :name => :poly_index - remove_index :impressions, :name => :controlleraction_index - remove_index :impressions, :user_id - - drop_table :impressions - end -end \ No newline at end of file diff --git a/test_app/db/schema.rb b/test_app/db/schema.rb deleted file mode 100644 index caf8529..0000000 --- a/test_app/db/schema.rb +++ /dev/null @@ -1,45 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20110212032114) do - - create_table "articles", :force => true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "impressions", :force => true do |t| - t.string "impressionable_type" - t.integer "impressionable_id" - t.integer "user_id" - t.string "controller_name" - t.string "action_name" - t.string "view_name" - t.string "request_hash" - t.string "ip_address" - t.string "message" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "impressions", ["controller_name", "action_name", "request_hash", "ip_address"], :name => "controlleraction_index" - add_index "impressions", ["impressionable_type", "impressionable_id", "request_hash", "ip_address"], :name => "poly_index" - add_index "impressions", ["user_id"], :name => "index_impressions_on_user_id" - - create_table "posts", :force => true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - -end diff --git a/test_app/spec/generators_spec.rb b/test_app/spec/generators_spec.rb deleted file mode 100644 index f44472c..0000000 --- a/test_app/spec/generators_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' -require 'systemu' - -describe Impressionist do - it "should delete existing migration and generate the migration file" do - migrations_dir = "#{Rails.root}/db/migrate" - impressions_migration = Dir.entries(migrations_dir).grep(/impressions/)[0] - File.delete("#{migrations_dir}/#{impressions_migration}") unless impressions_migration.blank? - generator_output = systemu("rails g impressionist")[1] - migration_name = generator_output.split("migrate/")[1].strip - Dir.entries(migrations_dir).include?(migration_name).should be true - end - - it "should run the migration created in the previous spec" do - migrate_output = systemu("rake db:migrate") - migrate_output[1].include?("CreateImpressionsTable: migrated").should be true - end -end \ No newline at end of file