implement uuid and make sample data factory
This commit is contained in:
@@ -12,7 +12,7 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('devices', function (Blueprint $table) {
|
||||
$table->string('device_id')->unique();
|
||||
$table->uuid('device_id')->primary();
|
||||
$table->string('title');
|
||||
$table->string('device_type');
|
||||
$table->string('description')->nullable();
|
||||
|
@@ -12,11 +12,10 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('location_transactions', function (Blueprint $table) {
|
||||
$table->string('location_transaction_id')->unique();
|
||||
$table->uuid('location_transaction_id')->primary();
|
||||
$table->string('room_code');
|
||||
$table->string('timestamp_located_since');
|
||||
$table->string('device_id');
|
||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
||||
$table->foreignUUid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -12,11 +12,10 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('owner_transactions', function (Blueprint $table) {
|
||||
$table->string('owner_transaction_id')->unique();
|
||||
$table->uuid('owner_transaction_id')->primary();
|
||||
$table->string('rz_username');
|
||||
$table->string('timestamp_owner_since');
|
||||
$table->string('device_id');
|
||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
||||
$table->foreignUuid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -12,14 +12,13 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('purchasing_information', function (Blueprint $table) {
|
||||
$table->string('purchasing_information_id')->unique();
|
||||
$table->uuid('purchasing_information_id')->primary();
|
||||
$table->string('price');
|
||||
$table->string('timestamp_warranty_end');
|
||||
$table->string('timestamp_purchase');
|
||||
$table->string('cost_centre');
|
||||
$table->string('seller')->nullable();
|
||||
$table->string('device_id');
|
||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
||||
$table->foreignUuid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user