Fix code quality violations and enhance ROUTE-EXISTS-01 rule
Implement JQHTML function cache ID system and fix bundle compilation Implement underscore prefix for system tables Fix JS syntax linter to support decorators and grant exception to Task system SPA: Update planning docs and wishlists with remaining features SPA: Document Navigation API abandonment and future enhancements Implement SPA browser integration with History API (Phase 1) Convert contacts view page to SPA action Convert clients pages to SPA actions and document conversion procedure SPA: Merge GET parameters and update documentation Implement SPA route URL generation in JavaScript and PHP Implement SPA bootstrap controller architecture Add SPA routing manual page (rsx:man spa) Add SPA routing documentation to CLAUDE.md Phase 4 Complete: Client-side SPA routing implementation Update get_routes() consumers for unified route structure Complete SPA Phase 3: PHP-side route type detection and is_spa flag Restore unified routes structure and Manifest_Query class Refactor route indexing and add SPA infrastructure Phase 3 Complete: SPA route registration in manifest Implement SPA Phase 2: Extract router code and test decorators Rename Jqhtml_Component to Component and complete SPA foundation setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -286,6 +286,26 @@
|
||||
"created_at": "2025-11-05T18:40:39+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe add_is_verified_to_login_user_table"
|
||||
},
|
||||
"2025_11_13_193740_modify_flash_alerts_table_for_type_based_system.php": {
|
||||
"created_at": "2025-11-13T19:37:40+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe modify_flash_alerts_table_for_type_based_system"
|
||||
},
|
||||
"2025_11_16_093331_drop_file_thumbnails_table.php": {
|
||||
"created_at": "2025-11-16T09:33:31+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe drop_file_thumbnails_table"
|
||||
},
|
||||
"2025_11_16_200145_create_tasks_table.php": {
|
||||
"created_at": "2025-11-16T20:01:45+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe create_tasks_table"
|
||||
},
|
||||
"2025_11_19_054000_rename_system_tables_to_underscore_prefix.php": {
|
||||
"created_at": "2025-11-19T05:40:00+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe rename_system_tables_to_underscore_prefix"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,34 +59,7 @@ return new class extends Migration
|
||||
FOREIGN KEY (site_id) REFERENCES sites(id) ON DELETE CASCADE
|
||||
");
|
||||
|
||||
// Step 9: Populate users_new with data from old users table
|
||||
// For each user in old users table, create a site-specific user record with site_id=1
|
||||
DB::statement("
|
||||
INSERT INTO users_new (
|
||||
login_user_id, site_id, first_name, last_name, phone,
|
||||
role_id, is_enabled, user_role_id, email,
|
||||
created_at, updated_at, created_by, updated_by
|
||||
)
|
||||
SELECT
|
||||
u.id as login_user_id,
|
||||
1 as site_id,
|
||||
u.first_name,
|
||||
u.last_name,
|
||||
u.phone,
|
||||
CASE
|
||||
WHEN u.user_role_id >= 5 THEN 1 -- ROOT_ADMIN → OWNER
|
||||
WHEN u.user_role_id >= 3 THEN 2 -- ADMIN → ADMIN
|
||||
ELSE 3 -- STANDARD/READ_ONLY → MEMBER
|
||||
END as role_id,
|
||||
1 as is_enabled,
|
||||
u.user_role_id,
|
||||
NULL as email,
|
||||
u.created_at,
|
||||
u.updated_at,
|
||||
u.created_by,
|
||||
u.updated_by
|
||||
FROM users u
|
||||
");
|
||||
// Step 9: Removed - no longer populating users_new from old users table
|
||||
|
||||
// Step 10: Drop foreign key constraints from other tables that reference users
|
||||
DB::statement("ALTER TABLE user_invites DROP FOREIGN KEY user_invites_ibfk_1");
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* IMPORTANT: Use raw MySQL queries for clarity and auditability
|
||||
* ✅ DB::statement("ALTER TABLE users ADD COLUMN age BIGINT")
|
||||
* ❌ Schema::table() with Blueprint
|
||||
*
|
||||
* REQUIRED: ALL tables MUST have: id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY
|
||||
* No exceptions - every table needs this exact ID column (SIGNED for easier migrations)
|
||||
*
|
||||
* Integer types: Use BIGINT for all integers, TINYINT(1) for booleans only
|
||||
* Never use unsigned - all integers should be signed
|
||||
*
|
||||
* Migrations must be self-contained - no Model/Service references
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Add type_id column for flash message types (uses model enum: 1=success, 2=error, 3=info, 4=warning)
|
||||
DB::statement("ALTER TABLE flash_alerts ADD COLUMN type_id BIGINT NOT NULL AFTER session_id");
|
||||
|
||||
// Remove class_attribute column (no longer needed - type determines styling)
|
||||
DB::statement("ALTER TABLE flash_alerts DROP COLUMN class_attribute");
|
||||
}
|
||||
|
||||
/**
|
||||
* down() method is prohibited in RSpade framework
|
||||
* Migrations should only move forward, never backward
|
||||
* You may remove this comment as soon as you see it and understand.
|
||||
*/
|
||||
};
|
||||
26
database/migrations/2025_11_16_093331_drop_file_thumbnails_table.php
Executable file
26
database/migrations/2025_11_16_093331_drop_file_thumbnails_table.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* Drop file_thumbnails table - no longer needed.
|
||||
* Thumbnail caching is now filesystem-only for simplicity and performance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement("DROP TABLE IF EXISTS file_thumbnails");
|
||||
}
|
||||
|
||||
/**
|
||||
* down() method is prohibited in RSpade framework
|
||||
* Migrations should only move forward, never backward
|
||||
* You may remove this comment as soon as you see it and understand.
|
||||
*/
|
||||
};
|
||||
79
database/migrations/2025_11_16_200145_create_tasks_table.php
Executable file
79
database/migrations/2025_11_16_200145_create_tasks_table.php
Executable file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* IMPORTANT: Use raw MySQL queries for clarity and auditability
|
||||
* ✅ DB::statement() with raw SQL
|
||||
* ❌ Schema::create() with Blueprint
|
||||
*
|
||||
* REQUIRED: ALL tables MUST have: id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY
|
||||
* No exceptions - every table needs this exact ID column (SIGNED for easier migrations)
|
||||
*
|
||||
* Integer types: Use BIGINT for all integers, TINYINT(1) for booleans only
|
||||
* Never use unsigned - all integers should be signed
|
||||
*
|
||||
* Migrations must be self-contained - no Model/Service references
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement("
|
||||
CREATE TABLE _tasks (
|
||||
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
-- Task identification
|
||||
class VARCHAR(255) NOT NULL COMMENT 'Fully qualified class name',
|
||||
method VARCHAR(255) NOT NULL COMMENT 'Static method name to execute',
|
||||
queue VARCHAR(255) NOT NULL DEFAULT 'default' COMMENT 'Queue name for concurrency control',
|
||||
|
||||
-- Status tracking
|
||||
status VARCHAR(50) NOT NULL DEFAULT 'pending' COMMENT 'pending, running, completed, failed, stuck',
|
||||
|
||||
-- Data storage
|
||||
params JSON NULL COMMENT 'Serialized task parameters',
|
||||
result JSON NULL COMMENT 'Task result data',
|
||||
logs TEXT NULL COMMENT 'Accumulated log messages',
|
||||
error TEXT NULL COMMENT 'Error message if task failed',
|
||||
|
||||
-- Scheduling
|
||||
scheduled_for DATETIME NULL COMMENT 'When task should execute (NULL = ASAP)',
|
||||
next_run_at DATETIME NULL COMMENT 'Next run time for recurring scheduled tasks',
|
||||
|
||||
-- Execution tracking
|
||||
started_at DATETIME NULL COMMENT 'When task execution began',
|
||||
completed_at DATETIME NULL COMMENT 'When task finished (success or failure)',
|
||||
last_heartbeat_at DATETIME NULL COMMENT 'Last heartbeat from worker process',
|
||||
|
||||
-- Worker management
|
||||
timeout BIGINT NULL COMMENT 'Maximum execution time in seconds (NULL = use default)',
|
||||
worker_pid BIGINT NULL COMMENT 'Process ID of worker executing this task',
|
||||
lock_key VARCHAR(255) NULL COMMENT 'MySQL advisory lock key for this task',
|
||||
|
||||
-- Timestamps
|
||||
created_at DATETIME NULL DEFAULT NULL,
|
||||
updated_at DATETIME NULL DEFAULT NULL,
|
||||
|
||||
-- Indexes for performance
|
||||
INDEX idx_status (status),
|
||||
INDEX idx_queue (queue),
|
||||
INDEX idx_scheduled_for (scheduled_for),
|
||||
INDEX idx_next_run_at (next_run_at),
|
||||
INDEX idx_worker_pid (worker_pid),
|
||||
INDEX idx_status_queue (status, queue)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* down() method is prohibited in RSpade framework
|
||||
* Migrations should only move forward, never backward
|
||||
* You may remove this comment as soon as you see it and understand.
|
||||
*/
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Rename system tables to use underscore prefix
|
||||
*
|
||||
* System tables are internal framework infrastructure that developers
|
||||
* should not access directly. The underscore prefix:
|
||||
* 1. Signals these are framework-managed tables
|
||||
* 2. Exempts them from ORM requirements (DB::table() allowed)
|
||||
* 3. Clarifies architectural boundaries
|
||||
*
|
||||
* See: /system/app/RSpade/man/database_schema_architecture.txt
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Rename system tables to underscore prefix
|
||||
// These are purely framework implementation details
|
||||
|
||||
DB::statement("RENAME TABLE file_storage TO _file_storage");
|
||||
DB::statement("RENAME TABLE file_attachments TO _file_attachments");
|
||||
DB::statement("RENAME TABLE flash_alerts TO _flash_alerts");
|
||||
DB::statement("RENAME TABLE search_indexes TO _search_indexes");
|
||||
|
||||
// Note: migrations table will be renamed manually after this migration runs
|
||||
// Note: _tasks already has underscore prefix
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user