Skip to content

Commit

Permalink
Merge pull request #74 from felixhahnweilheim/fix-updated-at
Browse files Browse the repository at this point in the history
Rename column 'last_update' to 'updated_at'
  • Loading branch information
luke- authored May 14, 2024
2 parents d49f1e4 + dfdd28a commit f368081
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changelog
=========
- Fix #74: save datetime of last update of a page

1.4.1 (November 28, 2023)
-------------------------
Expand Down
27 changes: 27 additions & 0 deletions migrations/m240510_161238_fix_updated_at.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use yii\db\Migration;

/**
* Class m240510_161238_fix_updated_at
*/
class m240510_161238_fix_updated_at extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$this->renameColumn('legal_page', 'last_update', 'updated_at');
$this->alterColumn('legal_page', 'updated_at', 'datetime');
}

/**
* {@inheritdoc}
*/
public function down()
{
$this->renameColumn('legal_page', 'updated_at', 'last_update');
$this->alterColumn('legal_page', 'last_update', 'int');
}
}

0 comments on commit f368081

Please sign in to comment.