From 4a69d5d133f8a1010c3e6b2f3c8cffea68037723 Mon Sep 17 00:00:00 2001 From: Graphictoria Date: Sun, 12 Jun 2022 21:25:50 -0400 Subject: [PATCH] More asset migration stuff, still need to work on the actual implementation. --- web/app/Models/AssetVersion.php | 11 ++++++ .../2022_06_05_140351_create_assets_table.php | 4 +- ..._12_210756_create_asset_versions_table.php | 39 +++++++++++++++++++ web/public/.htaccess | 4 ++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 web/app/Models/AssetVersion.php create mode 100644 web/database/migrations/2022_06_12_210756_create_asset_versions_table.php diff --git a/web/app/Models/AssetVersion.php b/web/app/Models/AssetVersion.php new file mode 100644 index 0000000..7cd36cf --- /dev/null +++ b/web/app/Models/AssetVersion.php @@ -0,0 +1,11 @@ +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(); diff --git a/web/database/migrations/2022_06_12_210756_create_asset_versions_table.php b/web/database/migrations/2022_06_12_210756_create_asset_versions_table.php new file mode 100644 index 0000000..9405707 --- /dev/null +++ b/web/database/migrations/2022_06_12_210756_create_asset_versions_table.php @@ -0,0 +1,39 @@ +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'); + } +}; diff --git a/web/public/.htaccess b/web/public/.htaccess index 896ae41..923c17e 100644 --- a/web/public/.htaccess +++ b/web/public/.htaccess @@ -2,6 +2,10 @@ Options -MultiViews -Indexes ErrorDocument 403 /index.php + + Require all denied + + RewriteEngine On # Handle Authorization Header