Sha256: 0ade351095448230edce56f16447928bef0bb1d81b0a3db1151763e903c93ecc

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

module Github
  module Archive
    module CreateArchive
      def self.do
        ActiveRecord::Schema.define do
          unless Github::Archive::ArchivedUrl.table_exists?
            create_table :archived_urls do |table|
              table.column :url, :string
              table.column :finished_processing, :boolean
            end

            add_index :archived_urls,:url
          end

          unless Github::Archive::Event.table_exists?
            create_table :events do |table|
              table.column :url, :string
              table.column :event_type, :string
              table.column :gh_created_at, :datetime
            end

            add_index :events, :url
            add_index :events, :event_type
            add_index :events, :gh_created_at
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github-archive-0.0.1 lib/github/archive/create_archive.rb