Sha256: c77841e242c2279278422ebe3b320b6a8391d7fc43cc00f23a34a510820cadc2

Contents?: true

Size: 956 Bytes

Versions: 1

Compression:

Stored size: 956 Bytes

Contents

class CreateGoogleSafeBrowsingTables < ActiveRecord::Migration
  def self.up

    create_table :gsb_full_hashes do |t|
      t.string  :full_hash
      t.integer :add_chunk_number
      t.string  :list
    end
    add_index :gsb_full_hashes, :full_hash, length: 190

    create_table :gsb_add_shavars do |t|
      t.string :prefix
      t.string :host_key
      t.integer :chunk_number, :null => false
      t.string :list, :null => false
    end
    add_index :gsb_add_shavars, :host_key
    add_index :gsb_add_shavars, :prefix

    create_table :gsb_sub_shavars do |t|
      t.string :prefix
      t.string :host_key
      t.integer :add_chunk_number
      t.integer :chunk_number, :null => false
      t.string :list, :null => false
    end
    add_index :gsb_sub_shavars, :host_key
    add_index :gsb_sub_shavars, :prefix

  end

  def self.down
    drop_table :gsb_add_shavars
    drop_table :gsb_sub_shavars
    drop_table :gsb_full_hashes
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google_safe_browsing-0.6.5 lib/generators/templates/create_google_safe_browsing_tables.rb