Files
MoneyFlix/crm/Core/Database/Migrations/CreateUserActivitiesTable.php
1sonhador 0283e966a9 MoneyFlix: Add remaining assets and source maps
- Add source maps and license files for compiled assets
- Add debug and test files for development
- Complete Git repository with all necessary files for MoneyFlix project
2025-10-22 18:09:55 +01:00

31 lines
925 B
PHP

<?php
namespace App\Core\Database\Migrations;
use App\Core\Database\Migration;
class CreateUserActivitiesTable extends Migration
{
public function up(): void
{
$this->createTable('user_activities', function($table) {
$table->bigInteger('id')->autoIncrement()->notNull();
$table->bigInteger('user_id');
$table->string('action', 100);
$table->string('description', 255);
$table->text('metadata')->nullable();
$table->string('ip_address', 45)->nullable();
$table->string('user_agent', 500)->nullable();
$table->timestamp('created_at')->default('CURRENT_TIMESTAMP')->notNull();
$table->primaryKey('id');
$table->index('user_id');
$table->index('action');
});
}
public function down(): void
{
$this->dropTable('user_activities');
}
}