Sha256: 8040c560c2b8bbe44cf1db3aa3233fdbba21bacd62a0e7bd59a8f3120f719885

Contents?: true

Size: 1.41 KB

Versions: 27

Compression:

Stored size: 1.41 KB

Contents

class CreateHttpLogs < ActiveRecord::Migration[5.2]
  def change
    create_table :http_logs do |t|
      # request
      t.string :http_method, comment: '请求方法'
      t.text :url, comment: '请求 URL'
      t.string :data_type, comment: 'data 参数类型 (form/json)'
      t.text :headers, comment: '请求 header'
      t.text :query_params, comment: 'url 参数'
      t.text :data, comment: 'body, get/delete 为空'

      # request builder
      t.text :other_params, comment: '其他自定义参数, 用于构建 query_params/data_type'
      t.string :request_digest, comment: '请求唯一 id'
      t.boolean :request_valid, comment: '请求是否符合规范, 若为 false, 不会发起请求'
      t.boolean :force, comment: '忽略缓存, 强制请求'

      # response
      t.integer :status_code, comment: 'response http code'
      t.text :response, comment: 'response body'
      t.text :response_headers, comment: 'response header'

      # response checker
      t.boolean :response_valid, comment: '请求结果 true/false, 这个要根据业务逻辑来设定. 不能靠 status_code 来确定'
      t.text :response_data, comment: '格式化后的 response'

      # relation
      t.string :client_type, comment: '请求类型'
      t.string :requestable_id, comment: '外键 ID'
      t.string :requestable_type, comment: '外键 类型'
      t.integer :parent_id

      t.timestamps
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
http_store-0.5.3 db/migrate/1_create_http_logs.rb
http_store-0.5.2 db/migrate/1_create_http_logs.rb
http_store-0.5.1 db/migrate/1_create_http_logs.rb
http_store-0.5.0 db/migrate/1_create_http_logs.rb
http_store-0.3.27 db/migrate/1_create_http_logs.rb
http_store-0.3.26 db/migrate/1_create_http_logs.rb
http_store-0.3.25 db/migrate/1_create_http_logs.rb
http_store-0.3.24 db/migrate/1_create_http_logs.rb
http_store-0.3.23 db/migrate/1_create_http_logs.rb
http_store-0.3.22 db/migrate/1_create_http_logs.rb
http_store-0.3.21 db/migrate/1_create_http_logs.rb
http_store-0.3.20 db/migrate/1_create_http_logs.rb
http_store-0.3.19 db/migrate/1_create_http_logs.rb
http_store-0.3.18 db/migrate/1_create_http_logs.rb
http_store-0.3.17 db/migrate/1_create_http_logs.rb
http_store-0.3.16 db/migrate/1_create_http_logs.rb
http_store-0.3.15 db/migrate/1_create_http_logs.rb
http_store-0.3.14 db/migrate/1_create_http_logs.rb
http_store-0.3.13 db/migrate/1_create_http_logs.rb
http_store-0.3.12 db/migrate/1_create_http_logs.rb