- Created separate MoneyFlix project directory - Copied Node.js redirector from production server - Added CRM PHP code (Redirects module, Core classes, Config, Routes, Views) - Created comprehensive documentation (README_MONEYFLIX.md) - Added sync script to keep CRM code updated (sync-from-crm.sh) - Configured .gitignore for Node.js and PHP - Set up proper project structure for multi-client isolation This separates MoneyFlix from the main CRM to avoid confusion between different client systems and provides a dedicated environment for MoneyFlix-specific development and maintenance.
50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Core\Database\Migration;
|
|
|
|
/**
|
|
* Add last_login column to users table
|
|
*
|
|
* Migration to add the missing last_login column that is required
|
|
* by the dashboard and user analytics systems.
|
|
*/
|
|
class AddLastLoginToUsersTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migration
|
|
*/
|
|
public function up(): void
|
|
{
|
|
// Add last_login column to users table
|
|
$this->addColumn('users', 'last_login', 'TIMESTAMP NULL DEFAULT NULL COMMENT "Last login timestamp for user activity tracking"');
|
|
|
|
// Add index for better query performance
|
|
$this->addIndex('users', 'idx_users_last_login', ['last_login']);
|
|
|
|
echo "Added last_login column to users table with index\n";
|
|
}
|
|
|
|
/**
|
|
* Reverse the migration
|
|
*/
|
|
public function down(): void
|
|
{
|
|
// Remove index first
|
|
$this->dropIndex('users', 'idx_users_last_login');
|
|
|
|
// Remove column
|
|
$this->dropColumn('users', 'last_login');
|
|
|
|
echo "Removed last_login column and index from users table\n";
|
|
}
|
|
|
|
/**
|
|
* Get migration description
|
|
*/
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add last_login column to users table for activity tracking';
|
|
}
|
|
}
|