|
|
@@ -21,10 +21,14 @@ class CreateStationTaskChildren extends Migration
|
|
|
$table->index('station_task_table_id','station_task_table_type');
|
|
|
$table->timestamps();
|
|
|
});
|
|
|
- Schema::table('station_tasks', function (Blueprint $table) {
|
|
|
- $table->dropIndex('station_taskable_type');
|
|
|
- $table->dropColumn('station_taskable_type');
|
|
|
- $table->dropColumn('station_taskable_id');
|
|
|
+ Schema::table('station_task_batches', function (Blueprint $table) {
|
|
|
+ $table->dropColumn('station_id');
|
|
|
+ });
|
|
|
+ Schema::table('station_task_commodities', function (Blueprint $table) {
|
|
|
+ $table->dropColumn('station_id');
|
|
|
+ });
|
|
|
+ Schema::table('station_task_material_boxes', function (Blueprint $table) {
|
|
|
+ $table->dropColumn('station_id');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -35,11 +39,15 @@ class CreateStationTaskChildren extends Migration
|
|
|
*/
|
|
|
public function down()
|
|
|
{
|
|
|
- Schema::dropIfExists('station_task_children');
|
|
|
- Schema::table('station_tasks', function (Blueprint $table) {
|
|
|
- $table->string('station_taskable_type');
|
|
|
- $table->integer('station_taskable_id');
|
|
|
- $table->index(['station_taskable_id','station_taskable_id'],'station_taskable_type');
|
|
|
+ Schema::table('station_task_batches', function (Blueprint $table) {
|
|
|
+ $table->integer('station_id')->index();
|
|
|
});
|
|
|
+ Schema::table('station_task_commodities', function (Blueprint $table) {
|
|
|
+ $table->integer('station_id')->index();
|
|
|
+ });
|
|
|
+ Schema::table('station_task_material_boxes', function (Blueprint $table) {
|
|
|
+ $table->integer('station_id')->index();
|
|
|
+ });
|
|
|
+ Schema::dropIfExists('station_task_children');
|
|
|
}
|
|
|
}
|