我需要首先使用 laravel 遷移在 Sql 中添加一列。我可以使用 after 在任何地方添加新列: Schema::table('tasks', function (Blueprint $table) { if (Schema::hasColumn('tasks', 'assigned_to_id') == false) { $table->integer('assigned_to_id')->after('status'); } });表有以下字段: project_id , module_id我需要在 project_id 之前添加列“id”。如何實現(xiàn)這一目標(biāo)?提前致謝!
- 1 回答
- 0 關(guān)注
- 112 瀏覽
添加回答
舉報
0/150
提交
取消