Sha256: a388ea75e309472b3c478246b2a94f8bf9443e98544233a63c122b3050475442

Contents?: true

Size: 865 Bytes

Versions: 6

Compression:

Stored size: 865 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
  def change
    create_table :searchjoy_searches do |t|
      t.references :user
      t.string :search_type
      t.string :query
      t.string :normalized_query
      t.integer :results_count
      t.datetime :created_at
      t.datetime :converted_at
    end

    add_index :searchjoy_searches, [:created_at]
    add_index :searchjoy_searches, [:search_type, :created_at]
    add_index :searchjoy_searches, [:search_type, :normalized_query, :created_at], name: "index_searchjoy_searches_on_search_type_query" # autogenerated name is too long

    create_table :searchjoy_conversions do |t|
      t.references :search
      t.references :convertable, polymorphic: true, index: {name: "index_searchjoy_conversions_on_convertable"}
      t.datetime :created_at
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
searchjoy-1.3.2 lib/generators/searchjoy/templates/install.rb.tt
searchjoy-1.3.1 lib/generators/searchjoy/templates/install.rb.tt
searchjoy-1.3.0 lib/generators/searchjoy/templates/install.rb.tt
searchjoy-1.2.0 lib/generators/searchjoy/templates/install.rb.tt
searchjoy-1.1.0 lib/generators/searchjoy/templates/install.rb.tt
searchjoy-1.0.0 lib/generators/searchjoy/templates/install.rb.tt