# 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: 20161110154413) do create_table "delayed_jobs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false t.text "handler", limit: 65535, null: false t.text "last_error", limit: 65535 t.datetime "run_at" t.datetime "locked_at" t.datetime "failed_at" t.string "locked_by" t.string "queue" t.datetime "created_at" t.datetime "updated_at" t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree end create_table "jobs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "pipeline_id", null: false t.integer "project_id" t.string "pipeline_stage" t.string "key", null: false t.string "status", default: "PENDING", null: false t.string "commit" t.string "branch" t.string "worker" t.json "spec" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["pipeline_id"], name: "index_jobs_on_pipeline_id", using: :btree t.index ["project_id"], name: "index_jobs_on_project_id", using: :btree end create_table "pipelines", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "project_id" t.string "definition" t.json "event" t.text "variables", limit: 65535 t.string "stage" t.string "status" t.string "error" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["project_id"], name: "index_pipelines_on_project_id", using: :btree end create_table "projects", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name" t.string "repo_provider" t.string "repo_owner" t.string "repo_name" t.string "repo_id" t.json "enabled_pipelines" t.boolean "enabled" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "team_id" t.integer "user_id" t.index ["team_id"], name: "index_projects_on_team_id", using: :btree t.index ["user_id"], name: "index_projects_on_user_id", using: :btree end create_table "teams", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name" t.string "provider" t.string "provider_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "user_teams", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "user_id" t.integer "team_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["team_id"], name: "index_user_teams_on_team_id", using: :btree t.index ["user_id"], name: "index_user_teams_on_user_id", using: :btree end create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name" t.string "provider", null: false t.string "provider_id", null: false t.string "email" t.string "username" t.string "token" t.string "refresh_token" t.datetime "created_at", null: false t.datetime "updated_at", null: false end add_foreign_key "jobs", "pipelines" add_foreign_key "jobs", "projects" add_foreign_key "pipelines", "projects" add_foreign_key "projects", "teams" add_foreign_key "projects", "users" add_foreign_key "user_teams", "teams" add_foreign_key "user_teams", "users" end