mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
Introduces a migration to add a created_at timestamp to the notes table. Updates the Note model and Notes controller to support filtering notes by creation date, and enhances the notes view to include date filter fields and display the created date for each note. Migration version is incremented to 242.
22 lines
439 B
PHP
22 lines
439 B
PHP
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Migration_add_created_at_to_notes extends CI_Migration {
|
|
|
|
public function up()
|
|
{
|
|
$fields = array(
|
|
'created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP',
|
|
);
|
|
|
|
if (!$this->db->field_exists('created_at', 'notes')) {
|
|
$this->dbforge->add_column('notes', $fields);
|
|
}
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->dbforge->drop_column('notes', 'created_at');
|
|
}
|
|
}
|