More asset migration stuff, still need to work on the actual implementation.
This commit is contained in:
parent
079513157c
commit
4a69d5d133
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class AssetVersion extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -28,8 +28,10 @@ return new class extends Migration
|
||||||
$table->boolean('onSale')->default(false);
|
$table->boolean('onSale')->default(false);
|
||||||
|
|
||||||
$table->unsignedSmallInteger('assetTypeId');
|
$table->unsignedSmallInteger('assetTypeId');
|
||||||
|
$table->unsignedBigInteger('assetVersionId')->comment('The most recent version id for the asset. This is used internally as asset version 0 when using the /asset api.');
|
||||||
|
|
||||||
// Calculating the thumbnail subdomain on runtime is too expensive.
|
// Calculating the subdomain on runtime is too expensive.
|
||||||
|
// So full URLs are used instead of just the hashes.
|
||||||
$table->string('thumbnailURL')->nullable();
|
$table->string('thumbnailURL')->nullable();
|
||||||
$table->string('3dThumbnailURL')->nullable();
|
$table->string('3dThumbnailURL')->nullable();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('asset_versions', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
|
||||||
|
$table->unsignedBigInteger('parentAsset');
|
||||||
|
$table->unsignedBigInteger('localVersion');
|
||||||
|
|
||||||
|
// Calculating the subdomain on runtime is too expensive.
|
||||||
|
// So full URLs are used instead of just the hashes.
|
||||||
|
$table->string('contentURL');
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('asset_versions');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -2,6 +2,10 @@ Options -MultiViews -Indexes
|
||||||
|
|
||||||
ErrorDocument 403 /index.php
|
ErrorDocument 403 /index.php
|
||||||
|
|
||||||
|
<Files "mix-manifest.json">
|
||||||
|
Require all denied
|
||||||
|
</Files>
|
||||||
|
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
# Handle Authorization Header
|
# Handle Authorization Header
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue