recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
@@ -0,0 +1,47 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddTimezoneToPreferencesAndSettings extends Migration
{
public function up()
{
// user_preferences.timezone
if ($this->db->tableExists('user_preferences') && ! $this->db->fieldExists('timezone', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'timezone' => [
'type' => 'VARCHAR',
'constraint' => 64,
'null' => true,
'after' => 'language',
],
]);
}
// settings.timezone (only if table exists)
if ($this->db->tableExists('settings') && ! $this->db->fieldExists('timezone', 'settings')) {
$this->forge->addColumn('settings', [
'timezone' => [
'type' => 'VARCHAR',
'constraint' => 64,
'null' => true,
'after' => 'name',
],
]);
}
}
public function down()
{
if ($this->db->tableExists('user_preferences') && $this->db->fieldExists('timezone', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'timezone');
}
if ($this->db->tableExists('settings') && $this->db->fieldExists('timezone', 'settings')) {
$this->forge->dropColumn('settings', 'timezone');
}
}
}