Skip to content

Commit ba7c88a

Browse files
committed
fix: quote reserved keyword "timestamp" used as a field name for session data with mysqli
1 parent f5b9ac7 commit ba7c88a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

system/Commands/Generators/Views/migration.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function up()
1515
'id' => ['type' => 'VARCHAR', 'constraint' => 128, 'null' => false],
1616
<?php if ($DBDriver === 'MySQLi'): ?>
1717
'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false],
18-
'timestamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL',
18+
'`timestamp` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL',
1919
'data' => ['type' => 'BLOB', 'null' => false],
2020
<?php elseif ($DBDriver === 'Postgre'): ?>
2121
'ip_address inet NOT NULL',

user_guide_src/source/changelogs/v4.6.4.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Bugs Fixed
4343
- **Database:** Fixed a bug in ``SQLite3`` where the password parameter was ignored unless it was an empty string.
4444
- **Debug:** Fixed a bug in ``ExceptionHandler`` where JSON encoding would fail when exception traces contained resources (e.g., database connections), closures, or circular references.
4545
- **Forge:** Fixed a bug in ``Postgre`` and ``SQLSRV`` where changing a column's default value using ``Forge::modifyColumn()`` method produced incorrect SQL syntax.
46+
- **Migrations:** Fixed a bug in the session table migration template where the ``timestamp`` field name conflicted with reserved keywords in MySQL/MariaDB.
4647
- **Model:** Fixed a bug in ``Model::replace()`` where ``created_at`` field (when available) wasn't set correctly.
4748
- **Model:** Fixed a bug in ``Model::insertBatch()`` and ``Model::updateBatch()`` where casts were not applied to inserted or updated values.
4849
- **Toolbar:** Fixed bugs in ``Collectors\Logs`` that were preventing the "Logs" tab from appearing on the Debug Toolbar.

0 commit comments

Comments
 (0)