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:
@@ -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)");
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user