Updated migrations
This commit is contained in:
@@ -14,7 +14,6 @@ class Extruder extends Model
|
|||||||
'description',
|
'description',
|
||||||
'manufacturer_id',
|
'manufacturer_id',
|
||||||
'diameter',
|
'diameter',
|
||||||
'temp_min',
|
|
||||||
'temp_max'
|
'temp_max'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('filament_types', function (Blueprint $table) {
|
Schema::create('filament_types', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description');
|
$table->string('description');
|
||||||
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('filaments', function (Blueprint $table) {
|
Schema::create('filaments', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
|
||||||
$table->string('name')->required();
|
$table->string('name')->required();
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
$table->string('color_id')->required();
|
$table->string('color_id')->required();
|
||||||
@@ -29,6 +28,7 @@ return new class extends Migration
|
|||||||
$table->integer('temp_max')->nullable();
|
$table->integer('temp_max')->nullable();
|
||||||
$table->integer('buildplate_id')->nullable();
|
$table->integer('buildplate_id')->nullable();
|
||||||
$table->integer('extruder_id')->nullable();
|
$table->integer('extruder_id')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('colors', function (Blueprint $table) {
|
Schema::create('colors', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
|
||||||
$table->string('name')->required();
|
$table->string('name')->required();
|
||||||
$table->string('hex')->required();
|
$table->string('hex')->required();
|
||||||
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('manufacturers', function (Blueprint $table) {
|
Schema::create('manufacturers', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
|
||||||
$table->string('name')->required();
|
$table->string('name')->required();
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
$table->string('website')->nullable();
|
$table->string('website')->nullable();
|
||||||
$table->string('logo')->nullable();
|
$table->string('logo')->nullable();
|
||||||
|
$table->integer('filament_count')->default(0);
|
||||||
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('extruders', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('description')->nullable();
|
||||||
|
$table->string('manufacturer_id')->required();
|
||||||
|
$table->string('diameter')->required();
|
||||||
|
$table->string('temp_max')->required();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('extruders');
|
||||||
|
}
|
||||||
|
};
|
||||||
+8
-7
@@ -11,9 +11,13 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('manufacturers', function (Blueprint $table) {
|
Schema::create('buildplates', function (Blueprint $table) {
|
||||||
//
|
$table->id();
|
||||||
$table->integer('filament_count')->default(0);
|
$table->string('name');
|
||||||
|
$table->string('description');
|
||||||
|
$table->foreignId('manufacturer_id')->constrained();
|
||||||
|
$table->string('temp_max');
|
||||||
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,9 +26,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::table('manufacturers', function (Blueprint $table) {
|
Schema::dropIfExists('buildplates');
|
||||||
//
|
|
||||||
$table->dropColumn('filament_count');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -16,6 +16,13 @@ class DatabaseSeeder extends Seeder
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
User::factory(10)->create();
|
User::factory(10)->create();
|
||||||
|
|
||||||
|
User::create([
|
||||||
|
'name' => 'Admin',
|
||||||
|
'email' => 'admin@local',
|
||||||
|
'password' => bcrypt('password')
|
||||||
|
]);
|
||||||
|
|
||||||
$this ->call(
|
$this ->call(
|
||||||
ColorSeeder::class,
|
ColorSeeder::class,
|
||||||
ManufacturerSeeder::class
|
ManufacturerSeeder::class
|
||||||
|
|||||||
Reference in New Issue
Block a user