Sha256: db55b2ec67152018bfde0091b552375cc909915cf7a0e2cd22a2e8b96f24981a

Contents?: true

Size: 815 Bytes

Versions: 16

Compression:

Stored size: 815 Bytes

Contents

MIGRATION_CLASS =
  if ActiveRecord::VERSION::MAJOR >= 5
    ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"]
  else
    ActiveRecord::Migration
  end

class CreateFriendlyIdSlugs < MIGRATION_CLASS
  def change
    create_table :friendly_id_slugs do |t|
      t.string   :slug,           :null => false
      t.integer  :sluggable_id,   :null => false
      t.string   :sluggable_type, :limit => 50
      t.string   :scope
      t.datetime :created_at
    end
    add_index :friendly_id_slugs, [:sluggable_type, :sluggable_id]
    add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
    add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
  end
end

Version data entries

16 entries across 15 versions & 4 rubygems

Version Path
phccodesnipper-6.1.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
phccodesnipper-6.0.1 db/migrate/20190513040626_create_friendly_id_slugs.rb
phccodesnipper-6.0.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
friendly_id-5.4.2 lib/friendly_id/migration.rb
friendly_id-5.4.1 lib/friendly_id/migration.rb
guider_cms-1.4.0 db/migrate/20200823100118_create_friendly_id_slugs.rb
friendly_id-5.4.0 lib/friendly_id/migration.rb
pageflow-15.1.0.beta1 entry_types/scrolled/spec/dummy/rails-5.2.0-pageflow-15.1.0.dev/db/migrate/20191204163053_create_friendly_id_slugs.rb
pageflow-15.1.0.beta1 entry_types/paged/spec/dummy/rails-5.2.0-pageflow-15.1.0.dev/db/migrate/20191204163015_create_friendly_id_slugs.rb
phccodesnipper-5.1.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
friendly_id-5.3.0 lib/friendly_id/migration.rb
phccodesnipper-5.0.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
phccodesnipper-4.0.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
phccodesnipper-3.0.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
phccodesnipper-1.1.0 db/migrate/20190513040626_create_friendly_id_slugs.rb
friendly_id-5.2.5 lib/friendly_id/migration.rb