| @@ 7-38 (lines=32) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateTicketUploadsTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create(config('laravel-tickets.database.ticket-uploads-table'), function (Blueprint $table) { |
|
| 17 | $table->id(); |
|
| 18 | $table->unsignedBigInteger('ticket_message_id'); |
|
| 19 | $table->string('path'); |
|
| 20 | $table->timestamps(); |
|
| 21 | ||
| 22 | if (! config('laravel-tickets.models.uuid')) { |
|
| 23 | $table->foreign('ticket_message_id') |
|
| 24 | ->on(config('laravel-tickets.database.ticket-messages-table'))->references('id'); |
|
| 25 | } |
|
| 26 | }); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Reverse the migrations. |
|
| 31 | * |
|
| 32 | * @return void |
|
| 33 | */ |
|
| 34 | public function down() |
|
| 35 | { |
|
| 36 | Schema::dropIfExists(config('laravel-tickets.database.ticket-uploads-table')); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 7-38 (lines=32) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateTicketReferencesTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create(config('laravel-tickets.database.ticket-references-table'), function (Blueprint $table) { |
|
| 17 | $table->id(); |
|
| 18 | $table->unsignedBigInteger('ticket_id'); |
|
| 19 | $table->morphs('referenceable'); |
|
| 20 | $table->timestamps(); |
|
| 21 | ||
| 22 | if (! config('laravel-tickets.models.uuid')) { |
|
| 23 | $table->foreign('ticket_id') |
|
| 24 | ->on(config('laravel-tickets.database.tickets-table'))->references('id'); |
|
| 25 | } |
|
| 26 | }); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Reverse the migrations. |
|
| 31 | * |
|
| 32 | * @return void |
|
| 33 | */ |
|
| 34 | public function down() |
|
| 35 | { |
|
| 36 | Schema::dropIfExists(config('laravel-tickets.database.ticket-references-table')); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||