Sha256: 06607c74d2d2f512de4db32d206c345a043448e9cd18bd14c4c1c1f81944c5d0

Contents?: true

Size: 783 Bytes

Versions: 13

Compression:

Stored size: 783 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

13 entries across 13 versions & 3 rubygems

Version Path
stay_commerce-0.1.7.2 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.7.1 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.7 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.6 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.5 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.4 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.3 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.2 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.1 db/migrate/20241205092943_create_friendly_id_slugs.rb
stay_commerce-0.1.0 db/migrate/20241205092943_create_friendly_id_slugs.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/friendly_id-5.5.1/lib/friendly_id/migration.rb
friendly_id-5.5.1 lib/friendly_id/migration.rb
friendly_id-5.5.0 lib/friendly_id/migration.rb