aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-08-01 11:27:28 -0700
committerJamie Winsor <jamie@enmasse.com>2011-08-03 18:01:32 -0700
commit21b19db5a30fcb6db83f4ac9302cc94c6320a0db (patch)
tree62a3b89d0f4c9b239bfd76ec77cfc3269ac041ef /spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb
parent3454a9c3007a4bfd10ccd0ff39dc594ebb2a0184 (diff)
downloadrefinerycms-blog-21b19db5a30fcb6db83f4ac9302cc94c6320a0db.tar.gz
refinerycms-blog-21b19db5a30fcb6db83f4ac9302cc94c6320a0db.tar.bz2
refinerycms-blog-21b19db5a30fcb6db83f4ac9302cc94c6320a0db.zip
refactor engine testing scenario
Engine is now tested standalone by leveraging a dummy rails app Enable Guard for speedy testing Move factories to the more standard location `spec/factories/*` Update README with a Testing section Rename migrations to contain datetimestamps for their version to fix migration order issues when migrating the dummy application
Diffstat (limited to 'spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb')
-rw-r--r--spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb b/spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb
new file mode 100644
index 0000000..3199a9c
--- /dev/null
+++ b/spec/dummy/db/migrate/20110802081556_create_refinerycms_core_schema.rb
@@ -0,0 +1,23 @@
+class CreateRefinerycmsCoreSchema < ActiveRecord::Migration
+ def self.up
+ create_table ::Slug.table_name, :force => true do |t|
+ t.string "name"
+ t.integer "sluggable_id"
+ t.integer "sequence", :default => 1, :null => false
+ t.string "sluggable_type", :limit => 40
+ t.string "scope", :limit => 40
+ t.datetime "created_at"
+ end
+
+ add_index ::Slug.table_name, ["name", "sluggable_type", "scope", "sequence"], :name => "index_#{::Slug.table_name}_on_n_s_s_and_s", :unique => true
+ add_index ::Slug.table_name, ["sluggable_id"], :name => "index_#{::Slug.table_name}_on_sluggable_id"
+ end
+
+ def self.down
+ [::Slug].reject{|m|
+ !(defined?(m) and m.respond_to?(:table_name))
+ }.each do |model|
+ drop_table model.table_name
+ end
+ end
+end