More asset migration stuff, still need to work on the actual implementation.

This commit is contained in:
Graphictoria 2022-06-12 21:25:50 -04:00
parent 079513157c
commit 4a69d5d133
4 changed files with 57 additions and 1 deletions

View File

@ -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;
}

View File

@ -28,8 +28,10 @@ return new class extends Migration
$table->boolean('onSale')->default(false);
$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('3dThumbnailURL')->nullable();

View File

@ -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');
}
};

View File

@ -2,6 +2,10 @@ Options -MultiViews -Indexes
ErrorDocument 403 /index.php
<Files "mix-manifest.json">
Require all denied
</Files>
RewriteEngine On
# Handle Authorization Header