Skip to content

Commit

Permalink
Module/Upgrade: Replace date to timestamp for import data from create…
Browse files Browse the repository at this point in the history
…d_at fields
  • Loading branch information
Nightprince committed Apr 20, 2024
1 parent 1ec8254 commit d716b37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/modules/install/controllers/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,12 @@ public function migrate(): void
{
// SQL: Append columns
$sql .= str_replace([':colName', ':colVal'], [$col, $structure['insert']['columns'][$key]], '`:colName` AS `:colVal`, ');

if ($data['cms'] == 'bcms2' && $col == 'created_at') {

// SQL: Replace date to timestamp
$sql = str_replace(['`created_at` AS `timestamp`, '], 'unix_timestamp(`created_at`) AS `timestamp`, ', $sql);
}
}

// SQL: Format
Expand Down

0 comments on commit d716b37

Please sign in to comment.