Many fixes

This commit is contained in:
root
2026-01-16 21:58:12 +03:00
parent b810a17649
commit 77f76c8c28
45 changed files with 3392 additions and 1243 deletions
@@ -0,0 +1,75 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
/**
* Миграция для создания таблицы настроек модулей
*
* Хранит переопределённые настройки модулей (цены, описание, триал).
*/
class CreateModuleSettingsTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'module_code' => [
'type' => 'VARCHAR',
'constraint' => 50,
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 100,
],
'description' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'price_monthly' => [
'type' => 'INT',
'constraint' => 11,
'default' => 0,
],
'price_yearly' => [
'type' => 'INT',
'constraint' => 11,
'default' => 0,
],
'trial_days' => [
'type' => 'INT',
'constraint' => 11,
'default' => 0,
],
'is_active' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 1,
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addUniqueKey('module_code');
$this->forge->createTable('module_settings');
}
public function down()
{
$this->forge->dropTable('module_settings', true);
}
}