Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

rename schemalessAttrributes

Andras Bacsai108c790cf4eb
diff --git a/app/Http/Livewire/Project/Application/Deploy.php b/app/Http/Livewire/Project/Application/Deploy.php
index 68c0a343e7..2ccc9a9b30 100644
--- a/app/Http/Livewire/Project/Application/Deploy.php
+++ b/app/Http/Livewire/Project/Application/Deploy.php
@@ -38,7 +38,7 @@ class Deploy extends Component
queue_application_deployment(
application: $this->application,
- metadata: [
+ extra_attributes: [
'deployment_uuid' => $this->deployment_uuid,
'application_uuid' => $this->application->uuid,
'force_rebuild' => $force,
diff --git a/app/Http/Livewire/Project/Application/Rollback.php b/app/Http/Livewire/Project/Application/Rollback.php
index 853e0f9cf5..0727840741 100644
--- a/app/Http/Livewire/Project/Application/Rollback.php
+++ b/app/Http/Livewire/Project/Application/Rollback.php
@@ -24,7 +24,7 @@ class Rollback extends Component
queue_application_deployment(
application: $this->application,
- metadata: [
+ extra_attributes: [
'deployment_uuid' => $deployment_uuid,
'application_uuid' => $this->application->uuid,
'force_rebuild' => false,
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index bef5a7ceef..ecb2769b8e 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -229,9 +229,9 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap
if ($next_found) {
dispatch(new ApplicationDeploymentJob(
application_deployment_queue_id: $next_found->id,
- deployment_uuid: $next_found->metadata['deployment_uuid'],
- application_uuid: $next_found->metadata['application_uuid'],
- force_rebuild: $next_found->metadata['force_rebuild'],
+ deployment_uuid: $next_found->extra_attributes['deployment_uuid'],
+ application_uuid: $next_found->extra_attributes['application_uuid'],
+ force_rebuild: $next_found->extra_attributes['force_rebuild'],
));
}
}
diff --git a/app/Models/ApplicationDeploymentQueue.php b/app/Models/ApplicationDeploymentQueue.php
index bc4d756eb7..1b492f42b5 100644
--- a/app/Models/ApplicationDeploymentQueue.php
+++ b/app/Models/ApplicationDeploymentQueue.php
@@ -11,14 +11,14 @@ class ApplicationDeploymentQueue extends Model
protected $fillable = [
'application_id',
'status',
- 'metadata',
+ 'extra_attributes',
];
public $casts = [
- 'metadata' => SchemalessAttributes::class,
+ 'extra_attributes' => SchemalessAttributes::class,
];
public function scopeWithExtraAttributes(): Builder
{
- return $this->metadata->modelScope();
+ return $this->extra_attributes->modelScope();
}
}
diff --git a/bootstrap/helpers/applications.php b/bootstrap/helpers/applications.php
index 72172a6db2..1a20437732 100644
--- a/bootstrap/helpers/applications.php
+++ b/bootstrap/helpers/applications.php
@@ -4,11 +4,11 @@ use App\Jobs\ApplicationDeploymentJob;
use App\Models\Application;
use App\Models\ApplicationDeploymentQueue;
-function queue_application_deployment(Application $application, $metadata)
+function queue_application_deployment(Application $application, $extra_attributes)
{
$deployment = ApplicationDeploymentQueue::create([
'application_id' => $application->id,
- 'metadata' => $metadata,
+ 'extra_attributes' => $extra_attributes,
]);
$queued_deployments = ApplicationDeploymentQueue::where('application_id', $application->id)->where('status', 'queued')->get()->sortByDesc('created_at');
$running_deployments = ApplicationDeploymentQueue::where('application_id', $application->id)->where('status', 'in_progress')->get()->sortByDesc('created_at');
@@ -24,9 +24,9 @@ function queue_application_deployment(Application $application, $metadata)
}
dispatch(new ApplicationDeploymentJob(
application_deployment_queue_id: $deployment->id,
- deployment_uuid: $metadata['deployment_uuid'],
- application_uuid: $metadata['application_uuid'],
- force_rebuild: $metadata['force_rebuild'],
- commit: $metadata['commit'] ?? null,
+ deployment_uuid: $extra_attributes['deployment_uuid'],
+ application_uuid: $extra_attributes['application_uuid'],
+ force_rebuild: $extra_attributes['force_rebuild'],
+ commit: $extra_attributes['commit'] ?? null,
));
}
diff --git a/database/migrations/2023_03_27_081716_create_applications_table.php b/database/migrations/2023_03_27_081716_create_applications_table.php
index e2116a4370..bad0343d5c 100644
--- a/database/migrations/2023_03_27_081716_create_applications_table.php
+++ b/database/migrations/2023_03_27_081716_create_applications_table.php
@@ -41,7 +41,7 @@ return new class extends Migration
$table->string('base_directory')->default('/');
$table->string('publish_directory')->nullable();
- $table->schemalessAttributes('previews');
+ $table->schemalessAttributes('extra_attributes');
$table->string('health_check_path')->default('/');
$table->string('health_check_port')->nullable();
diff --git a/database/migrations/2023_05_24_083426_create_application_deployment_queues_table.php b/database/migrations/2023_05_24_083426_create_application_deployment_queues_table.php
index 47796c02b5..f5d9d2cbc6 100644
--- a/database/migrations/2023_05_24_083426_create_application_deployment_queues_table.php
+++ b/database/migrations/2023_05_24_083426_create_application_deployment_queues_table.php
@@ -15,7 +15,7 @@ return new class extends Migration
$table->id();
$table->string('application_id');
$table->integer('pull_request_id')->default(0);
- $table->schemalessAttributes('metadata');
+ $table->schemalessAttributes('extra_attributes');
$table->string('status')->default('queued');
$table->timestamps();
});
diff --git a/resources/views/livewire/project/application/deployments.blade.php b/resources/views/livewire/project/application/deployments.blade.php
index d99f9a8413..bf1131cdfc 100644
--- a/resources/views/livewire/project/application/deployments.blade.php
+++ b/resources/views/livewire/project/application/deployments.blade.php
@@ -13,7 +13,7 @@
'border-error hover:bg-error' => $deployment->status === 'error',
'border-success hover:bg-success' => $deployment->status === 'finished',
]) @if ($deployment->status !== 'cancelled by system' && $deployment->status !== 'queued')
- href="{{ $current_url . '/' . $deployment->metadata['deployment_uuid'] }}"
+ href="{{ $current_url . '/' . $deployment->extra_attributes['deployment_uuid'] }}"
@endif
class="hover:no-underline">
<div class="flex flex-col justify-start">