diff --git a/app/models/build_failure.rb b/app/models/build_failure.rb new file mode 100644 index 00000000..a1fb9d3d --- /dev/null +++ b/app/models/build_failure.rb @@ -0,0 +1,11 @@ +class BuildFailure < ActiveRecord::Base + belongs_to :repo + belongs_to :branch + + def notify + + end + + def still_broken? + end +end diff --git a/db/migrate/20200109223351_create_build_failures.rb b/db/migrate/20200109223351_create_build_failures.rb new file mode 100644 index 00000000..7a0850a8 --- /dev/null +++ b/db/migrate/20200109223351_create_build_failures.rb @@ -0,0 +1,12 @@ +class CreateBuildFailures < ActiveRecord::Migration + def change + create_table :build_failures do |t| + t.integer :repo_id + t.integer :branch_id + t.integer :travis_build_id + + t.datetime :last_notified_at + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 6120ecb7..63875090 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171006050814) do +ActiveRecord::Schema.define(version: 20200109223351) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -48,6 +48,15 @@ t.integer "linter_offense_count" end + create_table "build_failures", force: :cascade do |t| + t.integer "repo_id" + t.integer "branch_id" + t.integer "travis_build_id" + t.datetime "last_notified_at" + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "repos", force: :cascade do |t| t.string "name", limit: 255 t.datetime "created_at"