From ca06108ed473781f275cc39eb2a0c2ed5b235efa Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 29 Nov 2018 19:12:07 +0500 Subject: [PATCH] Require attribute TelegramBot#api_token --- .../20181129141112_require_api_token_of_telegram_bots.rb | 7 +++++++ db/schema.rb | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20181129141112_require_api_token_of_telegram_bots.rb diff --git a/db/migrate/20181129141112_require_api_token_of_telegram_bots.rb b/db/migrate/20181129141112_require_api_token_of_telegram_bots.rb new file mode 100644 index 0000000..3400003 --- /dev/null +++ b/db/migrate/20181129141112_require_api_token_of_telegram_bots.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RequireApiTokenOfTelegramBots < ActiveRecord::Migration[5.2] + def change + change_column :telegram_bots, :api_token, :string, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index e9d9a90..be80b98 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_11_29_140421) do +ActiveRecord::Schema.define(version: 2018_11_29_141112) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -34,7 +34,7 @@ ActiveRecord::Schema.define(version: 2018_11_29_140421) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "secret", null: false - t.string "api_token" + t.string "api_token", null: false end end