Fix enum column validation and migration data types

Remove numbered emoji and add no-emoji policy to CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-21 07:33:24 +00:00
parent 9d44fcff55
commit faf34e1a9d
7 changed files with 41 additions and 23 deletions

View File

@@ -19,11 +19,11 @@ return new class extends Migration
public function up()
{
// Add status column (1=active, 2=inactive, 3=suspended)
DB::statement("ALTER TABLE users ADD COLUMN status TINYINT NOT NULL DEFAULT 1 AFTER is_verified");
DB::statement("ALTER TABLE users ADD COLUMN status INT NOT NULL DEFAULT 1 AFTER is_verified");
DB::statement("ALTER TABLE users ADD INDEX idx_status (status)");
// Add user_role_id column (1=read_only, 2=standard, 3=admin, 4=billing_admin, 5=root_admin)
DB::statement("ALTER TABLE users ADD COLUMN user_role_id TINYINT NOT NULL DEFAULT 2 AFTER status");
DB::statement("ALTER TABLE users ADD COLUMN user_role_id INT NOT NULL DEFAULT 2 AFTER status");
DB::statement("ALTER TABLE users ADD INDEX idx_user_role_id (user_role_id)");
}

View File

@@ -19,7 +19,7 @@ return new class extends Migration
public function up()
{
// Rename status column to status_id to match enum naming convention
DB::statement("ALTER TABLE users CHANGE COLUMN status status_id TINYINT NOT NULL DEFAULT 1");
DB::statement("ALTER TABLE users CHANGE COLUMN status status_id INT NOT NULL DEFAULT 1");
// Recreate the index with the new column name
DB::statement("ALTER TABLE users DROP INDEX idx_status");

View File

@@ -31,8 +31,8 @@ return new class extends Migration
name VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10,2) NOT NULL,
status_id TINYINT NOT NULL DEFAULT 1,
category_id TINYINT NOT NULL DEFAULT 1,
status_id INT NOT NULL DEFAULT 1,
category_id INT NOT NULL DEFAULT 1,
created_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3),
updated_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
INDEX idx_status_id (status_id),