feat: add col version_name to app_update

v2.0.0
ricky rx 1 year ago
parent 22f99b29fa
commit b82fb64dd3

@ -48,6 +48,7 @@ class ApkUpdate extends Model {
'name' => 'required|string', 'name' => 'required|string',
'file' => 'required_without:id|file|' . FileHelper::convertToStrLaraValidation(FileHelper::$allowedApkExtensions), 'file' => 'required_without:id|file|' . FileHelper::convertToStrLaraValidation(FileHelper::$allowedApkExtensions),
'version_code' => 'required|integer|min:1', 'version_code' => 'required|integer|min:1',
'version_name' => 'required|string',
'change_note' => 'nullable|string' 'change_note' => 'nullable|string'
], [ ], [
'file' => ['required_without' => 'The file field is required.'] 'file' => ['required_without' => 'The file field is required.']
@ -72,6 +73,7 @@ class ApkUpdate extends Model {
} }
$apkUpdate->name = $request->name; $apkUpdate->name = $request->name;
$apkUpdate->version_code = $request->version_code; $apkUpdate->version_code = $request->version_code;
$apkUpdate->version_name = $request->version_name;
$apkUpdate->change_note = $request->change_note; $apkUpdate->change_note = $request->change_note;
$apkUpdate->save(); $apkUpdate->save();

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('apk_updates', function (Blueprint $table) {
$table->string('version_name', 50)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('apk_updates', function (Blueprint $table) {
$table->dropColumn('version_name');
});
}
};
Loading…
Cancel
Save