Skip to content

Commit

Permalink
Reset migrations to match current production migrations (0.70)
Browse files Browse the repository at this point in the history
  • Loading branch information
BDQ committed Feb 8, 2012
1 parent f116cf6 commit 00cacfe
Show file tree
Hide file tree
Showing 54 changed files with 129 additions and 584 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
class ExtendPages < ActiveRecord::Migration
class Page < ActiveRecord::Base
end

def self.up
change_table :pages do |t|
t.boolean :show_in_header, :default => false, :null => false
t.boolean :show_in_footer, :default => false, :null => false
t.string :foreign_link
t.integer :position, :default => 1, :null => false
if Page.table_exists?
Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)}
else
Spree::Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)}
end
Page.all(:order => "updated_at ASC").each_with_index{|page,x| page.update_attribute(:position, x+1)}

end
end
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20090814113100_add_visible_to_pages.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddVisibleToPages < ActiveRecord::Migration
def self.up
add_column :pages, :visible, :boolean
Page.update_all :visible => true
end

def self.down
remove_column :pages, :visible
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class AddCountOnHandToVariantsAndProducts < ActiveRecord::Migration
class Variant < ActiveRecord::Base; end
class Product < ActiveRecord::Base; end

def self.up
add_column :variants, :count_on_hand, :integer, :default => 0, :null => false
add_column :products, :count_on_hand, :integer, :default => 0, :null => false
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20091007134354_change_taxons_to_nested_set.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class ChangeTaxonsToNestedSet < ActiveRecord::Migration
class Taxon < ActiveRecord::Base; end;

def self.up
add_column :taxons, :lft, :integer
add_column :taxons, :rgt, :integer
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20091021133257_charge_refactoring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class Order < ActiveRecord::Base
has_one :checkout
end

class Adjustment < ActiveRecord::Base; end

def self.up
add_column :orders, :completed_at, :timestamp
Order.reset_column_information
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20091209202200_make_state_events_polymorphic.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class MakeStateEventsPolymorphic < ActiveRecord::Migration
class StateEvent < ActiveRecord::Base; end

def self.up
rename_column :state_events, :order_id, :stateful_id
add_column :state_events, :stateful_type, :string
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20100105132138_shipment_id_for_inventory_units.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class ShipmentIdForInventoryUnits < ActiveRecord::Migration
class Shipment < ActiveRecord::Base; end

def self.up
add_column "inventory_units", "shipment_id", :integer
add_index(:inventory_units, :shipment_id)
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20100209144531_polymorphic_payments.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class PolymorphicPayments < ActiveRecord::Migration
class Creditcard < ActiveRecord::Base; end

def self.up
remove_column :payments, :type
remove_column :payments, :creditcard_id
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20100306153445_fix_by_popularity.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class FixByPopularity < ActiveRecord::Migration
class ProductScope < ActiveRecord::Base; end

def self.up
ProductScope.update_all("name='descend_by_popularity'", "name='by_popularity'")
end
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20100506180619_add_icon_to_taxons.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class AddIconToTaxons < ActiveRecord::Migration
class Taxon < ActiveRecord::Base; end

def self.up
# skip this migration if the attribute already exists because of advanced taxon extension
return if Taxon.new.respond_to? :icon_file_name
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20100506185838_add_description_to_taxons.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class AddDescriptionToTaxons < ActiveRecord::Migration
class Taxon < ActiveRecord::Base; end

def self.up
# skip this migration if the attribute already exists because of advanced taxon extension
return if Taxon.new.respond_to? :description
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class UpdateCalculableTypeForPromotions < ActiveRecord::Migration
class Calculator < ActiveRecord::Base; end

def self.up
Calculator.update_all("calculable_type = 'Promotion'", "calculable_type = 'Coupon'")
end
Expand Down
4 changes: 1 addition & 3 deletions db/migrate/20101026184746_delete_in_progress_orders.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class DeleteInProgressOrders < ActiveRecord::Migration
class Order < ActiveRecord::Base; end

def self.up
Order.delete_all(:state=>'in_progress')
delete_orphans('adjustments')
Expand All @@ -17,4 +15,4 @@ def self.delete_orphans(table_name)

def self.down
end
end
end
2 changes: 0 additions & 2 deletions db/migrate/20101026184808_migrate_checkout_to_orders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ class MigrateCheckoutToOrders < ActiveRecord::Migration
class Checkout < ActiveRecord::Base
end

class Order < ActiveRecord::Base; end

def self.up
Order.find_each do |order|
checkout = update_order(order)
Expand Down
4 changes: 1 addition & 3 deletions db/migrate/20101026184855_remove_shipped_state.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class RemoveShippedState < ActiveRecord::Migration
class Order < ActiveRecord::Base; end

def self.up
Order.where(:state => 'shipped').each do |order|
order.update_attribute_without_callbacks("state", "complete")
Expand All @@ -13,4 +11,4 @@ def self.up

def self.down
end
end
end
5 changes: 1 addition & 4 deletions db/migrate/20101026184959_generate_anonymous_users.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class GenerateAnonymousUsers < ActiveRecord::Migration
class User < ActiveRecord::Base; end
class Order < ActiveRecord::Base; end

def self.up
User.reset_column_information
Order.where(:user_id => nil).each do |order|
Expand All @@ -14,4 +11,4 @@ def self.up

def self.down
end
end
end
4 changes: 1 addition & 3 deletions db/migrate/20101026185022_update_order_state.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
class UpdateOrderState < ActiveRecord::Migration
class Order < ActiveRecord::Base; end

def self.up
Order.all.map(&:update!)
end

def self.down
end
end
end
1 change: 0 additions & 1 deletion db/migrate/20101111133551_renamed_rma_cancelled_state.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class RenamedRmaCancelledState < ActiveRecord::Migration
class ReturnAuthorization < ActiveRecord::Base; end
def self.up
ReturnAuthorization.where(:state => 'cancelled').each do |rma|
rma.update_attribute_without_callbacks(:state, 'canceled')
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20101219201531_tokens_for_legacy_orders.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class TokensForLegacyOrders < ActiveRecord::Migration
class Order < ActiveRecord::Base; end

def self.up
# add token permissions for legacy orders (stop relying on user persistence token)
Order.all.each do |order|
Expand Down
2 changes: 0 additions & 2 deletions db/migrate/20110125135821_add_rrp_to_product.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class AddRrpToProduct < ActiveRecord::Migration
class Product < ActiveRecord::Base; end

def self.up
add_column :products, :rrp, :decimal, :precision => 8, :scale => 2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class RemoveTrailingSlashesInTaxonPermalinks < ActiveRecord::Migration
class Taxon < ActiveRecord::Base; end

def self.up
Taxon.find_each(:conditions => {}) do |t|
if t.permalink && t.permalink[-1..-1] == '/'
Expand Down
52 changes: 0 additions & 52 deletions db/migrate/20111201173432_namespace_top_level_models.rb

This file was deleted.

52 changes: 0 additions & 52 deletions db/migrate/20111201173433_migrate_namespaced_polymorphic_models.rb

This file was deleted.

5 changes: 0 additions & 5 deletions db/migrate/20111201173434_namespace_tokenized_permission.rb

This file was deleted.

9 changes: 0 additions & 9 deletions db/migrate/20111201173435_namespace_promo_tables.rb

This file was deleted.

56 changes: 0 additions & 56 deletions db/migrate/20120112163859_new_preferences.rb

This file was deleted.

9 changes: 0 additions & 9 deletions db/migrate/20120112163860_make_adjustments_polymorphic.rb

This file was deleted.

5 changes: 0 additions & 5 deletions db/migrate/20120112163861_add_company_to_addresses.rb

This file was deleted.

5 changes: 0 additions & 5 deletions db/migrate/20120112163862_add_inc_tax_to_tax_rates.rb

This file was deleted.

Loading

0 comments on commit 00cacfe

Please sign in to comment.