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,85 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddStyleToPreferences extends Migration
{
public function up()
{
if ($this->db->tableExists('user_preferences')) {
if (! $this->db->fieldExists('style_color', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'style_color' => [
'type' => 'VARCHAR',
'constraint' => 32,
'null' => true,
'after' => 'timezone',
],
]);
}
if (! $this->db->fieldExists('menu_color', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'menu_color' => [
'type' => 'VARCHAR',
'constraint' => 32,
'null' => true,
'after' => 'style_color',
],
]);
}
if (! $this->db->fieldExists('menu_custom_bg', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'menu_custom_bg' => [
'type' => 'VARCHAR',
'constraint' => 16,
'null' => true,
'after' => 'menu_color',
],
]);
}
if (! $this->db->fieldExists('menu_custom_text', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'menu_custom_text' => [
'type' => 'VARCHAR',
'constraint' => 16,
'null' => true,
'after' => 'menu_custom_bg',
],
]);
}
if (! $this->db->fieldExists('menu_custom_mode', 'user_preferences')) {
$this->forge->addColumn('user_preferences', [
'menu_custom_mode' => [
'type' => 'VARCHAR',
'constraint' => 8,
'null' => true,
'after' => 'menu_custom_text',
],
]);
}
}
}
public function down()
{
if ($this->db->tableExists('user_preferences')) {
if ($this->db->fieldExists('menu_custom_mode', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'menu_custom_mode');
}
if ($this->db->fieldExists('menu_custom_text', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'menu_custom_text');
}
if ($this->db->fieldExists('menu_custom_bg', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'menu_custom_bg');
}
if ($this->db->fieldExists('menu_color', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'menu_color');
}
if ($this->db->fieldExists('style_color', 'user_preferences')) {
$this->forge->dropColumn('user_preferences', 'style_color');
}
}
}
}