Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

2024_11_13_214149_create_offerings_table.php 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('offerings', function (Blueprint $table) {
  13. $table->id();
  14. $table->foreignId('company_id')->constrained()->cascadeOnDelete();
  15. $table->string('name')->index();
  16. $table->string('description')->nullable();
  17. $table->string('type')->nullable(); // product, service, etc.
  18. $table->integer('price')->default(0);
  19. $table->foreignId('income_account_id')->nullable()->constrained('accounts')->nullOnDelete(); // income account e.g. sales/invoice
  20. $table->foreignId('expense_account_id')->nullable()->constrained('accounts')->nullOnDelete(); // expense account e.g. purchase/bill
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. */
  27. public function down(): void
  28. {
  29. Schema::dropIfExists('offerings');
  30. }
  31. };