Sha256: f5834f8d504db648d73886968809fb8efb5bb6a7ba0a559c274830f139dd424e

Contents?: true

Size: 1.18 KB

Versions: 42

Compression:

Stored size: 1.18 KB

Contents

class CreateProxies < ActiveRecord::Migration
  def self.up
    create_table :proxies do |t|
      
      t.string :host, :null => false
      t.integer :port, :null => false
      t.string :username
      t.string :password
      
      t.string :protocol, :null => false, :default => 'http'
      t.string :proxy_type, :null => false, :defaut => 'public'
      t.string :category
      
      t.datetime :last_checked_at
      t.boolean :valid_proxy, :null => false, :default => false
      t.integer :successful_attempts, :null => false, :default => 0
      t.integer :failed_attempts, :null => false, :default => 0

      t.timestamps
    end
    
    add_index :proxies, [:host, :port], :unique => true, :name => 'index_unique_proxy'
    add_index :proxies, :protocol, :name => 'index_protocol'
    add_index :proxies, :proxy_type, :name => 'index_proxy_type'
    add_index :proxies, :category, :name => 'index_category'
    add_index :proxies, :valid_proxy, :name => 'index_valid_proxy'
    add_index :proxies, :successful_attempts, :name => 'index_successful_attempts'
    add_index :proxies, :failed_attempts, :name => 'index_failed_attempts'
  end

  def self.down
    drop_table :proxies
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
http_utilities-1.4.3 lib/generators/active_record/templates/migration.rb
http_utilities-1.4.2 lib/generators/active_record/templates/migration.rb
http_utilities-1.4.1 lib/generators/active_record/templates/migration.rb
http_utilities-1.4.0 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.9 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.8 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.7 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.6 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.5 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.4 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.3 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.2 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.1 lib/generators/active_record/templates/migration.rb
http_utilities-1.3.0 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.7 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.6.5 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.6.4 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.6.3 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.6.2 lib/generators/active_record/templates/migration.rb
http_utilities-1.2.6.1 lib/generators/active_record/templates/migration.rb