Sha256: 529220782bce1099f363e126d3fae1eb412289514ef1bb36ff2ffe105d86d979

Contents?: true

Size: 692 Bytes

Versions: 33

Compression:

Stored size: 692 Bytes

Contents

class UpgradeFriendlyIdTo20 < ActiveRecord::Migration

  def self.up
    remove_column :slugs, :updated_at
    remove_index :slugs, :column => [:name, :sluggable_type]
    add_column :slugs, :sequence, :integer, :null => false, :default => 1
    add_column :slugs, :scope, :string, :limit => 40
    add_index :slugs, [:name, :sluggable_type, :scope, :sequence], :unique => true, :name => "index_slugs_on_n_s_s_and_s"
  end

  def self.down
    remove_index :slugs, :name => "index_slugs_on_n_s_s_and_s"
    remove_column :slugs, :scope
    remove_column :slugs, :sequence
    add_column :slugs, :updated_at, :datetime
    add_index :slugs, [:name, :sluggable_type], :unique => true
  end

end

Version data entries

33 entries across 33 versions & 8 rubygems

Version Path
dougcole-friendly_id-2.0.2 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
dougcole-friendly_id-2.0.3 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
dougcole-friendly_id-2.0.4 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
dougcole-friendly_id-2.0.5 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
dougcole-friendly_id-2.0.6 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nateabbott-friendly_id-2.1.4 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nateabbott-friendly_id-2.1.7 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nateabbott-friendly_id-2.1.8 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nateabbott-nateabbott-friendly_id-2.1.5 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nateabbott-nateabbott-friendly_id-2.1.6 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.0.1 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.0.2 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.0.3 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.0.4 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.1.0 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.1.1 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.1.2 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
norman-friendly_id-2.1.3 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
nwp-friendly_id-2.1.3 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb
rakutenusa-friendly_id-2.0.6 generators/friendly_id_20_upgrade/templates/upgrade_friendly_id_to_20.rb