Sha256: d5fbf3fe8e223d86b7999291217d714419f6869535147d95254ce4ca398de6b6

Contents?: true

Size: 367 Bytes

Versions: 6

Compression:

Stored size: 367 Bytes

Contents

class AddVisitorCodeToSiteVisitors < ActiveRecord::Migration
  def change
    add_column :green_flag_site_visitors, :visitor_code, :string
    execute 'update green_flag_site_visitors set visitor_code = id'
    change_column :green_flag_site_visitors, :visitor_code, :string, null: false
    add_index :green_flag_site_visitors, :visitor_code, unique: true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
green_flag-0.4.0 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb
green_flag-0.3.0 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb
green_flag-0.2.0 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb
green_flag-0.1.2 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb
green_flag-0.1.1 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb
green_flag-0.1.0 db/migrate/20140505204611_add_visitor_code_to_site_visitors.rb