mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-30 14:15:07 +02:00
[MIG] Added checks#mode as an enum (auto, manual)
This commit is contained in:
parent
57b24e5e29
commit
18cccf9790
|
@ -1,6 +1,5 @@
|
||||||
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
|
||||||
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: checks
|
# Table name: checks
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
# kind :integer not null
|
# kind :integer not null
|
||||||
# last_run_at :datetime
|
# last_run_at :datetime
|
||||||
# last_success_at :datetime
|
# last_success_at :datetime
|
||||||
|
# mode :integer default("auto"), not null
|
||||||
# vendor :string(255)
|
# vendor :string(255)
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
@ -39,6 +39,7 @@ class Check < ApplicationRecord
|
||||||
reject_if: lambda { |at| at["recipient"].blank? && at["interval"].blank? }
|
reject_if: lambda { |at| at["recipient"].blank? && at["interval"].blank? }
|
||||||
|
|
||||||
enum kind: [:domain, :ssl]
|
enum kind: [:domain, :ssl]
|
||||||
|
enum mode: [:auto, :manual]
|
||||||
|
|
||||||
self.skip_time_zone_conversion_for_attributes = [
|
self.skip_time_zone_conversion_for_attributes = [
|
||||||
:domain_created_at,
|
:domain_created_at,
|
||||||
|
|
5
db/migrate/20180829134404_add_mode_to_checks.rb
Normal file
5
db/migrate/20180829134404_add_mode_to_checks.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddModeToChecks < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :checks, :mode, :integer, default: 0, null: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2018_08_01_072038) do
|
ActiveRecord::Schema.define(version: 2018_08_29_134404) do
|
||||||
|
|
||||||
create_table "check_logs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
create_table "check_logs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||||
t.bigint "check_id"
|
t.bigint "check_id"
|
||||||
|
@ -39,6 +39,7 @@ ActiveRecord::Schema.define(version: 2018_08_01_072038) do
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.integer "consecutive_failures", default: 0, null: false
|
t.integer "consecutive_failures", default: 0, null: false
|
||||||
|
t.integer "mode", default: 0, null: false
|
||||||
t.index ["user_id"], name: "index_checks_on_user_id"
|
t.index ["user_id"], name: "index_checks_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
||||||
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: checks
|
# Table name: checks
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
# kind :integer not null
|
# kind :integer not null
|
||||||
# last_run_at :datetime
|
# last_run_at :datetime
|
||||||
# last_success_at :datetime
|
# last_success_at :datetime
|
||||||
|
# mode :integer default("auto"), not null
|
||||||
# vendor :string(255)
|
# vendor :string(255)
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
@ -44,6 +44,7 @@ FactoryBot.define do
|
||||||
last_run_at nil
|
last_run_at nil
|
||||||
last_success_at nil
|
last_success_at nil
|
||||||
consecutive_failures 0
|
consecutive_failures 0
|
||||||
|
mode :auto
|
||||||
|
|
||||||
trait :domain do
|
trait :domain do
|
||||||
kind :domain
|
kind :domain
|
||||||
|
|
Loading…
Reference in a new issue