Skip to content

Commit f2fe6e3

Browse files
committed
Version 0.57.0
1 parent 8223cbc commit f2fe6e3

File tree

6 files changed

+89
-83
lines changed

6 files changed

+89
-83
lines changed

CHANGELOG.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
44
Exclamation symbols (:exclamation:) note something of importance e.g. breaking changes. Click them to learn more.
55

66
## [Unreleased]
7-
:exclamation: After updating to this version, you will need to execute the [SQL migration script][unreleased-sql-migration] on your database.
87
### Added
9-
- New logo! (#954)
10-
- Bot API 4.2 (Polls).
11-
- `getIsMember()` method to `ChatMember` entity.
12-
- `getForwardSenderName()` method to `Message` entity.
13-
- `forward_sender_name` (and forgotten `forward_signature`) DB fields.
14-
- Added missing API fields to Entities and DB.
15-
- Created database tables for `shipping_query` and `pre_checkout_query`.
168
### Changed
179
### Deprecated
1810
### Removed
1911
### Fixed
20-
- Missing DB table name specifier in `/cleanup` command. (#947)
2112
### Security
2213

14+
## [0.57.0] - 2019-06-01
15+
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.57.0-sql-migration] on your database.
16+
### Added
17+
- New logo! (#954)
18+
- Bot API 4.2 (Polls). (#948)
19+
- `getIsMember()` method to `ChatMember` entity. (#948)
20+
- `getForwardSenderName()` method to `Message` entity. (#948)
21+
- `forward_sender_name` (and forgotten `forward_signature`) DB fields. (#948)
22+
- Added missing API fields to Entities and DB. (#885)
23+
- Created database tables for `shipping_query` and `pre_checkout_query`. (#885)
24+
### Fixed
25+
- Missing DB table name specifier in `/cleanup` command. (#947)
26+
2327
## [0.56.0] - 2019-04-15
2428
### Added
2529
- Helper for sending `InputMedia` objects using `Request::sendMediaGroup()` and `Request::editMediaMessage()` methods. (#934)
@@ -258,6 +262,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
258262
- Move `hideKeyboard` to `removeKeyboard`.
259263

260264
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/unreleased.sql
265+
[0.57.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.56.0-0.57.0.sql
261266
[0.55.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.54.1-0.55.0.sql
262267
[0.55.0-bc-move-animation-out-of-games-namespace]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#move-animation-out-of-games-namespace
263268
[0.54.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.53.0-0.54.0.sql
@@ -277,6 +282,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
277282
[example-bot]: https://github.com/php-telegram-bot/example-bot
278283

279284
[Unreleased]: https://github.com/php-telegram-bot/core/compare/master...develop
285+
[0.57.0]: https://github.com/php-telegram-bot/core/compare/0.56.0...0.57.0
280286
[0.56.0]: https://github.com/php-telegram-bot/core/compare/0.55.1...0.56.0
281287
[0.55.1]: https://github.com/php-telegram-bot/core/compare/0.55.0...0.55.1
282288
[0.55.0]: https://github.com/php-telegram-bot/core/compare/0.54.1...0.55.0

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"guzzlehttp/guzzle": "^6.3"
3333
},
3434
"require-dev": {
35-
"phpunit/phpunit": "^4.8|^5.7|^6.5|^7.4|^8.1",
35+
"phpunit/phpunit": "^4.8|^5.7|^6.5|^7.5|^8.1",
3636
"squizlabs/php_codesniffer": "^3.4"
3737
},
3838
"autoload": {

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Telegram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Telegram
3030
*
3131
* @var string
3232
*/
33-
protected $version = '0.56.0';
33+
protected $version = '0.57.0';
3434

3535
/**
3636
* Telegram API key
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
ALTER TABLE `chat` ADD COLUMN `first_name` CHAR(255) DEFAULT NULL COMMENT 'First name of the other party in a private chat' AFTER `username`;
2+
ALTER TABLE `chat` ADD COLUMN `last_name` CHAR(255) DEFAULT NULL COMMENT 'Last name of the other party in a private chat' AFTER `first_name`;
3+
ALTER TABLE `message` ADD COLUMN `forward_signature` TEXT NULL DEFAULT NULL COMMENT 'For messages forwarded from channels, signature of the post author if present' AFTER `forward_from_message_id`;
4+
ALTER TABLE `message` ADD COLUMN `forward_sender_name` TEXT NULL DEFAULT NULL COMMENT 'Sender''s name for messages forwarded from users who disallow adding a link to their account in forwarded messages' AFTER `forward_signature`;
5+
ALTER TABLE `message` ADD COLUMN `edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Date the message was last edited in Unix time' AFTER `reply_to_message`;
6+
ALTER TABLE `message` ADD COLUMN `author_signature` TEXT COMMENT 'Signature of the post author for messages in channels' AFTER `media_group_id`;
7+
ALTER TABLE `message` ADD COLUMN `caption_entities` TEXT COMMENT 'For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption';
8+
ALTER TABLE `message` ADD COLUMN `animation` TEXT NULL COMMENT 'Message is an animation, information about the animation' AFTER `document`;
9+
ALTER TABLE `message` ADD COLUMN `poll` TEXT COMMENT 'Poll object. Message is a native poll, information about the poll' AFTER `venue`;
10+
ALTER TABLE `message` ADD COLUMN `invoice` TEXT NULL COMMENT 'Message is an invoice for a payment, information about the invoice' AFTER `pinned_message`;
11+
ALTER TABLE `message` ADD COLUMN `successful_payment` TEXT NULL COMMENT 'Message is a service message about a successful payment, information about the payment' AFTER `invoice`;
12+
ALTER TABLE `callback_query` ADD COLUMN `chat_instance` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent' AFTER `inline_message_id`;
13+
ALTER TABLE `callback_query` ADD COLUMN `game_short_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Short name of a Game to be returned, serves as the unique identifier for the game' AFTER `data`;
14+
15+
CREATE TABLE IF NOT EXISTS `shipping_query` (
16+
`id` bigint UNSIGNED COMMENT 'Unique query identifier',
17+
`user_id` bigint COMMENT 'User who sent the query',
18+
`invoice_payload` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Bot specified invoice payload',
19+
`shipping_address` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User specified shipping address',
20+
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
21+
22+
PRIMARY KEY (`id`),
23+
KEY `user_id` (`user_id`),
24+
25+
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
26+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
27+
28+
CREATE TABLE IF NOT EXISTS `pre_checkout_query` (
29+
`id` bigint UNSIGNED COMMENT 'Unique query identifier',
30+
`user_id` bigint COMMENT 'User who sent the query',
31+
`currency` CHAR(3) COMMENT 'Three-letter ISO 4217 currency code',
32+
`total_amount` bigint COMMENT 'Total price in the smallest units of the currency',
33+
`invoice_payload` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Bot specified invoice payload',
34+
`shipping_option_id` CHAR(255) NULL COMMENT 'Identifier of the shipping option chosen by the user',
35+
`order_info` TEXT NULL COMMENT 'Order info provided by the user',
36+
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
37+
38+
PRIMARY KEY (`id`),
39+
KEY `user_id` (`user_id`),
40+
41+
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
42+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
43+
44+
CREATE TABLE IF NOT EXISTS `poll` (
45+
`id` bigint UNSIGNED COMMENT 'Unique poll identifier',
46+
`question` char(255) NOT NULL COMMENT 'Poll question',
47+
`options` text NOT NULL COMMENT 'List of poll options',
48+
`is_closed` tinyint(1) DEFAULT 0 COMMENT 'True, if the poll is closed',
49+
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
50+
51+
PRIMARY KEY (`id`)
52+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
53+
54+
ALTER TABLE `telegram_update` ADD COLUMN `channel_post_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming channel post of any kind - text, photo, sticker, etc.';
55+
ALTER TABLE `telegram_update` ADD COLUMN `edited_channel_post_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New version of a channel post that is known to the bot and was edited';
56+
ALTER TABLE `telegram_update` ADD COLUMN `shipping_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming shipping query. Only for invoices with flexible price';
57+
ALTER TABLE `telegram_update` ADD COLUMN `pre_checkout_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming pre-checkout query. Contains full information about checkout';
58+
ALTER TABLE `telegram_update` ADD COLUMN `poll_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New poll state. Bots receive only updates about polls, which are sent or stopped by the bot';
59+
60+
ALTER TABLE `telegram_update` ADD KEY `channel_post_id` (`channel_post_id`);
61+
ALTER TABLE `telegram_update` ADD KEY `edited_channel_post_id` (`edited_channel_post_id`);
62+
ALTER TABLE `telegram_update` ADD KEY `shipping_query_id` (`shipping_query_id`);
63+
ALTER TABLE `telegram_update` ADD KEY `pre_checkout_query_id` (`pre_checkout_query_id`);
64+
ALTER TABLE `telegram_update` ADD KEY `poll_id` (`poll_id`);
65+
66+
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`chat_id`, `channel_post_id`) REFERENCES `message` (`chat_id`, `id`);
67+
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`edited_channel_post_id`) REFERENCES `edited_message` (`id`);
68+
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`shipping_query_id`) REFERENCES `shipping_query` (`id`);
69+
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`pre_checkout_query_id`) REFERENCES `pre_checkout_query` (`id`);
70+
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`);

utils/db-schema-update/unreleased.sql

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +0,0 @@
1-
ALTER TABLE `chat` ADD COLUMN `first_name` CHAR(255) DEFAULT NULL COMMENT 'First name of the other party in a private chat' AFTER `username`;
2-
ALTER TABLE `chat` ADD COLUMN `last_name` CHAR(255) DEFAULT NULL COMMENT 'Last name of the other party in a private chat' AFTER `first_name`;
3-
ALTER TABLE `message` ADD COLUMN `forward_signature` TEXT NULL DEFAULT NULL COMMENT 'For messages forwarded from channels, signature of the post author if present' AFTER `forward_from_message_id`;
4-
ALTER TABLE `message` ADD COLUMN `forward_sender_name` TEXT NULL DEFAULT NULL COMMENT 'Sender''s name for messages forwarded from users who disallow adding a link to their account in forwarded messages' AFTER `forward_signature`;
5-
ALTER TABLE `message` ADD COLUMN `edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Date the message was last edited in Unix time' AFTER `reply_to_message`;
6-
ALTER TABLE `message` ADD COLUMN `author_signature` TEXT COMMENT 'Signature of the post author for messages in channels' AFTER `media_group_id`;
7-
ALTER TABLE `message` ADD COLUMN `caption_entities` TEXT COMMENT 'For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption';
8-
ALTER TABLE `message` ADD COLUMN `animation` TEXT NULL COMMENT 'Message is an animation, information about the animation' AFTER `document`;
9-
ALTER TABLE `message` ADD COLUMN `poll` TEXT COMMENT 'Poll object. Message is a native poll, information about the poll' AFTER `venue`;
10-
ALTER TABLE `message` ADD COLUMN `invoice` TEXT NULL COMMENT 'Message is an invoice for a payment, information about the invoice' AFTER `pinned_message`;
11-
ALTER TABLE `message` ADD COLUMN `successful_payment` TEXT NULL COMMENT 'Message is a service message about a successful payment, information about the payment' AFTER `invoice`;
12-
ALTER TABLE `callback_query` ADD COLUMN `chat_instance` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent' AFTER `inline_message_id`;
13-
ALTER TABLE `callback_query` ADD COLUMN `game_short_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Short name of a Game to be returned, serves as the unique identifier for the game' AFTER `data`;
14-
15-
CREATE TABLE IF NOT EXISTS `shipping_query` (
16-
`id` bigint UNSIGNED COMMENT 'Unique query identifier',
17-
`user_id` bigint COMMENT 'User who sent the query',
18-
`invoice_payload` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Bot specified invoice payload',
19-
`shipping_address` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User specified shipping address',
20-
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
21-
22-
PRIMARY KEY (`id`),
23-
KEY `user_id` (`user_id`),
24-
25-
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
26-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
27-
28-
CREATE TABLE IF NOT EXISTS `pre_checkout_query` (
29-
`id` bigint UNSIGNED COMMENT 'Unique query identifier',
30-
`user_id` bigint COMMENT 'User who sent the query',
31-
`currency` CHAR(3) COMMENT 'Three-letter ISO 4217 currency code',
32-
`total_amount` bigint COMMENT 'Total price in the smallest units of the currency',
33-
`invoice_payload` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Bot specified invoice payload',
34-
`shipping_option_id` CHAR(255) NULL COMMENT 'Identifier of the shipping option chosen by the user',
35-
`order_info` TEXT NULL COMMENT 'Order info provided by the user',
36-
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
37-
38-
PRIMARY KEY (`id`),
39-
KEY `user_id` (`user_id`),
40-
41-
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
42-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
43-
44-
CREATE TABLE IF NOT EXISTS `poll` (
45-
`id` bigint UNSIGNED COMMENT 'Unique poll identifier',
46-
`question` char(255) NOT NULL COMMENT 'Poll question',
47-
`options` text NOT NULL COMMENT 'List of poll options',
48-
`is_closed` tinyint(1) DEFAULT 0 COMMENT 'True, if the poll is closed',
49-
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
50-
51-
PRIMARY KEY (`id`)
52-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
53-
54-
ALTER TABLE `telegram_update` ADD COLUMN `channel_post_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming channel post of any kind - text, photo, sticker, etc.';
55-
ALTER TABLE `telegram_update` ADD COLUMN `edited_channel_post_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New version of a channel post that is known to the bot and was edited';
56-
ALTER TABLE `telegram_update` ADD COLUMN `shipping_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming shipping query. Only for invoices with flexible price';
57-
ALTER TABLE `telegram_update` ADD COLUMN `pre_checkout_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming pre-checkout query. Contains full information about checkout';
58-
ALTER TABLE `telegram_update` ADD COLUMN `poll_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New poll state. Bots receive only updates about polls, which are sent or stopped by the bot';
59-
60-
ALTER TABLE `telegram_update` ADD KEY `channel_post_id` (`channel_post_id`);
61-
ALTER TABLE `telegram_update` ADD KEY `edited_channel_post_id` (`edited_channel_post_id`);
62-
ALTER TABLE `telegram_update` ADD KEY `shipping_query_id` (`shipping_query_id`);
63-
ALTER TABLE `telegram_update` ADD KEY `pre_checkout_query_id` (`pre_checkout_query_id`);
64-
ALTER TABLE `telegram_update` ADD KEY `poll_id` (`poll_id`);
65-
66-
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`chat_id`, `channel_post_id`) REFERENCES `message` (`chat_id`, `id`);
67-
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`edited_channel_post_id`) REFERENCES `edited_message` (`id`);
68-
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`shipping_query_id`) REFERENCES `shipping_query` (`id`);
69-
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`pre_checkout_query_id`) REFERENCES `pre_checkout_query` (`id`);
70-
ALTER TABLE `telegram_update` ADD FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`);

0 commit comments

Comments
 (0)