From b518fd97fb5b2594806a8fe246a6227b3016a7c2 Mon Sep 17 00:00:00 2001 From: Dmitry Davydov Date: Thu, 31 Mar 2022 23:38:32 +0300 Subject: [PATCH] 716252: update telegram_id type --- CHANGELOG.md | 4 ++++ db/migrate/004_change_telegram_id_to_decimal.rb | 5 +++++ init.rb | 2 +- test/unit/redmine_bots/account_test.rb | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/004_change_telegram_id_to_decimal.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5eb3f..df22f07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.5.1 + +* Fix problem with telegram_id exceeding int. + # 0.5.0 * Use supergroup chats diff --git a/db/migrate/004_change_telegram_id_to_decimal.rb b/db/migrate/004_change_telegram_id_to_decimal.rb new file mode 100644 index 0000000..6fc2154 --- /dev/null +++ b/db/migrate/004_change_telegram_id_to_decimal.rb @@ -0,0 +1,5 @@ +class ChangeTelegramIdToDecimal < Rails.version < '5.0' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] + def change + change_column :telegram_accounts, :telegram_id, :decimal + end +end diff --git a/init.rb b/init.rb index 1df8427..6990ee0 100644 --- a/init.rb +++ b/init.rb @@ -29,7 +29,7 @@ name 'Redmine Bots' url 'https://github.com/centosadmin/redmine_bots' description 'This is a platform for building Redmine bots' - version '0.5.0' + version '0.5.1' author 'Southbridge' author_url 'https://github.com/centosadmin' diff --git a/test/unit/redmine_bots/account_test.rb b/test/unit/redmine_bots/account_test.rb index 72aa6ac..1b05312 100644 --- a/test/unit/redmine_bots/account_test.rb +++ b/test/unit/redmine_bots/account_test.rb @@ -2,7 +2,7 @@ class TelegramAccountTest < ActiveSupport::TestCase def setup - @telegram_account = TelegramAccount.new first_name: 'John', last_name: 'Smith' + @telegram_account = TelegramAccount.new first_name: 'John', last_name: 'Smith', telegram_id: 999_999_999_999 end def test_name_without_username