Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename column 'last_update' to 'updated_at' #74

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
}
}