Differential D4142 Diff 12038 src/database/migrations/2021_11_25_100000_create_shared_folders_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_11_25_100000_create_shared_folders_table.php
Show All 40 Lines | public function up() | ||||
$table->text('value'); | $table->text('value'); | ||||
$table->timestamps(); | $table->timestamps(); | ||||
$table->foreign('shared_folder_id')->references('id')->on('shared_folders') | $table->foreign('shared_folder_id')->references('id')->on('shared_folders') | ||||
->onDelete('cascade')->onUpdate('cascade'); | ->onDelete('cascade')->onUpdate('cascade'); | ||||
$table->unique(['shared_folder_id', 'key']); | $table->unique(['shared_folder_id', 'key']); | ||||
} | } | ||||
); | ); | ||||
\App\Sku::where('title', 'shared_folder')->update([ | |||||
'active' => true, | |||||
'cost' => 0, | |||||
'title' => 'shared-folder', | |||||
]); | |||||
if (!\App\Sku::where('title', 'beta-shared-folders')->first()) { | |||||
\App\Sku::create([ | |||||
'title' => 'beta-shared-folders', | |||||
'name' => 'Shared folders', | |||||
'description' => 'Access to shared folders', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\SharedFolders', | |||||
'active' => true, | |||||
]); | |||||
} | |||||
} | } | ||||
machniak: I suppose, if we do such cleanup, this one could also be removed. | |||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
Schema::dropIfExists('shared_folder_settings'); | Schema::dropIfExists('shared_folder_settings'); | ||||
Schema::dropIfExists('shared_folders'); | Schema::dropIfExists('shared_folders'); | ||||
// there's no need to remove the SKU | // there's no need to remove the SKU | ||||
} | } | ||||
} | } |
I suppose, if we do such cleanup, this one could also be removed.