Merge branch 'migrate-to-mysql' into 'master'
fix: update migrations to make it compatible with mysql databases See merge request ldc-web/projets/gen-game-web!41
This commit is contained in:
commit
a5bbbfdcef
3 changed files with 10 additions and 5 deletions
|
|
@ -45,7 +45,9 @@ class Participation extends Model
|
|||
* @var array<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'barcode', 'ticket', 'sticker',
|
||||
'barcode',
|
||||
'ticket',
|
||||
'sticker',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -179,7 +181,7 @@ class Participation extends Model
|
|||
public function eanCode(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => optional($this->product)->ean_code,
|
||||
get: fn() => optional($this->product)->ean_code,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +221,7 @@ class Participation extends Model
|
|||
public static function customerAlreadyHasAnInstantWin(Customer $customer): bool
|
||||
{
|
||||
return self::query()->whereHas('instantWin')
|
||||
->whereHas('customer', fn (Builder $q) => $q->where('id', $customer->id))
|
||||
->whereHas('customer', fn(Builder $q) => $q->where('id', $customer->id))
|
||||
->exists();
|
||||
}
|
||||
|
||||
|
|
@ -240,5 +242,8 @@ class Participation extends Model
|
|||
if ($model->sticker) {
|
||||
$model->sticker = FileStorageHelper::storeFile($model, $model->sticker, true);
|
||||
}
|
||||
if (!$model->comment) {
|
||||
$model->comment = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "uwil/gen-game-web",
|
||||
"version": "2.4.6",
|
||||
"version": "2.4.7",
|
||||
"type": "project",
|
||||
"description": "Game generator",
|
||||
"support": {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ return new class extends Migration
|
|||
$table->string('barcode')->nullable()
|
||||
->comment('Si gagnant, fichier image du code-barres du produit acheté');
|
||||
|
||||
$table->text('comment')->default('')->comment('Si gagnant, Commentaire des gestionnaires du jeu');
|
||||
$table->text('comment')->comment('Si gagnant, Commentaire des gestionnaires du jeu');
|
||||
$table->boolean('prize_sent')->default(0)->comment('Si gagnant, alors est-ce-que le lot à été envoyé ?');
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue