Skip to content

Commit 2282f7e

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into bot_api_5.1
2 parents 5b70fc8 + 91a5aa0 commit 2282f7e

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
55

66
## [Unreleased]
77
### Notes
8-
- [:ledger: View file changes][Unreleased]
8+
- [:ledger: View file changes][Unreleased][:page_with_curl: DB migration script][unreleased-sql-migration]
99
### Added
1010
- Bot API 5.1 (ChatMember Update types, Improved Invite Links, Voice Chat). (@massadm, @noplanman)
1111
### Changed
1212
### Deprecated
1313
### Removed
1414
### Fixed
15+
- `message.edit_date` is now of type `timestamp`.
1516
### Security
1617

1718
## [0.71.0] - 2021-03-05
@@ -502,6 +503,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
502503
### Deprecated
503504
- Move `hideKeyboard` to `removeKeyboard`.
504505

506+
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.71.0-unreleased.sql
505507
[0.70.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.64.0-0.70.0.sql
506508
[0.70.0-bc-minimum-php-73]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#minimum-php-73
507509
[0.63.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.62.0-0.63.0.sql

src/DB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ public static function insertMessageRequest(Message $message): bool
11101110
$sth->bindValue(':reply_to_message', $reply_to_message_id);
11111111

11121112
$sth->bindValue(':via_bot', $via_bot_id);
1113-
$sth->bindValue(':edit_date', $message->getEditDate());
1113+
$sth->bindValue(':edit_date', self::getTimestamp($message->getEditDate()));
11141114
$sth->bindValue(':media_group_id', $message->getMediaGroupId());
11151115
$sth->bindValue(':author_signature', $message->getAuthorSignature());
11161116
$sth->bindValue(':text', $message->getText());

structure.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS `message` (
8282
`reply_to_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier',
8383
`reply_to_message` bigint UNSIGNED DEFAULT NULL COMMENT 'Message that this message is reply to',
8484
`via_bot` bigint NULL DEFAULT NULL COMMENT 'Optional. Bot through which the message was sent',
85-
`edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Date the message was last edited in Unix time',
85+
`edit_date` timestamp NULL DEFAULT NULL COMMENT 'Date the message was last edited in Unix time',
8686
`media_group_id` TEXT COMMENT 'The unique identifier of a media message group this message belongs to',
8787
`author_signature` TEXT COMMENT 'Signature of the post author for messages in channels',
8888
`text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4',

utils/db-schema-update/0.71.0-unreleased.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ALTER TABLE `message` MODIFY `edit_date` timestamp NULL DEFAULT NULL COMMENT 'Date the message was last edited in Unix time';
2+
13
CREATE TABLE IF NOT EXISTS `chat_member_updated` (
24
`id` BIGINT UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry',
35
`chat_id` BIGINT NOT NULL COMMENT 'Chat the user belongs to',

0 commit comments

Comments
 (0)