Skip to content

Instantly share code, notes, and snippets.

@breim
Created August 5, 2019 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breim/6cae1b68d080d5a49adfe0514d3198e0 to your computer and use it in GitHub Desktop.
Save breim/6cae1b68d080d5a49adfe0514d3198e0 to your computer and use it in GitHub Desktop.
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_05_31_222245) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "analytic_records", force: :cascade do |t|
t.string "session"
t.string "watched_token"
t.string "current_time"
t.boolean "ended", default: false
t.float "watched_percentage", default: 0.0
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.decimal "total_bandwidth", default: "0.0"
end
create_table "analytics", force: :cascade do |t|
t.string "session"
t.string "watched_token"
t.string "system_name"
t.string "browser_name"
t.string "browser_version"
t.string "screen_resolution"
t.string "referer"
t.string "ip"
t.string "current_time"
t.boolean "mobile", default: false
t.boolean "desktop", default: false
t.string "duration", default: "0.0"
t.boolean "ended", default: false
t.float "watched_percentage", default: 0.0
t.string "city"
t.string "country"
t.string "region"
t.boolean "analized", default: false
t.bigint "video_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.decimal "total_bandwidth", default: "0.0"
t.string "latitude"
t.string "longitude"
t.index ["video_id"], name: "index_analytics_on_video_id"
end
create_table "instances", force: :cascade do |t|
t.string "code"
t.string "ip"
t.string "status"
t.string "private_ip_address"
t.datetime "deleted_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "plan_payments", force: :cascade do |t|
t.bigint "user_id"
t.string "pagarme_transaction_id"
t.string "card_brand"
t.string "card_last_digits"
t.decimal "price"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_plan_payments_on_user_id"
end
create_table "spot_instances", force: :cascade do |t|
t.string "state"
t.string "spot_instance_request_id"
t.string "instance_code"
t.string "spot_price"
t.string "availability_zone"
t.string "message"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "tickets", force: :cascade do |t|
t.string "name"
t.text "description"
t.bigint "user_id"
t.string "phone"
t.string "email"
t.boolean "solved", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_tickets_on_user_id"
end
create_table "transcoder_error_logs", force: :cascade do |t|
t.bigint "video_id"
t.string "file_hash"
t.text "error_message"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["video_id"], name: "index_transcoder_error_logs_on_video_id"
end
create_table "uploads", force: :cascade do |t|
t.string "token"
t.string "presigned_url"
t.boolean "active", default: true
t.bigint "video_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["video_id"], name: "index_uploads_on_video_id"
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.string "provider"
t.string "uid"
t.boolean "disabled", default: false
t.date "plan_date"
t.string "card_id"
t.string "card_brand"
t.string "card_last_digits"
t.string "card_expiration"
t.boolean "plan_status", default: false
t.string "api_token"
t.boolean "admin", default: false
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "videos", force: :cascade do |t|
t.string "name"
t.string "original_file_name"
t.string "presigned_file_name"
t.string "token"
t.boolean "on_queue", default: false
t.boolean "processed", default: false
t.boolean "deleted", default: false
t.datetime "processed_at"
t.bigint "user_id"
t.boolean "activated", default: true
t.string "duration"
t.string "postback_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "file_size"
t.boolean "file_uploaded", default: false
t.boolean "enable_embedded", default: true
t.string "embedded_domain", default: ""
t.boolean "transcoder_error", default: false
t.bigint "instance_id"
t.boolean "sanitized", default: false
t.index ["instance_id"], name: "index_videos_on_instance_id"
t.index ["user_id"], name: "index_videos_on_user_id"
end
add_foreign_key "analytics", "videos"
add_foreign_key "plan_payments", "users"
add_foreign_key "tickets", "users"
add_foreign_key "transcoder_error_logs", "videos"
add_foreign_key "uploads", "videos"
add_foreign_key "videos", "instances"
add_foreign_key "videos", "users"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment