mirror of
https://github.com/BillyOutlast/UNIT3D.git
synced 2026-02-04 03:01:20 +01:00
refactor: use plural table names
Leave out history and tv for now as their plural isn't obvious.
This commit is contained in:
@@ -39,7 +39,7 @@ class StoreTransactionRequest extends FormRequest
|
||||
return [
|
||||
'exchange' => [
|
||||
'required',
|
||||
'exists:bon_exchange,id',
|
||||
'exists:bon_exchanges,id',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -20,13 +20,6 @@ class BonExchange extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'bon_exchange';
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
*
|
||||
|
||||
@@ -24,8 +24,6 @@ class Collection extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $table = 'collection';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment>
|
||||
*/
|
||||
|
||||
@@ -24,8 +24,6 @@ class Company extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'companies';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Movie>
|
||||
*/
|
||||
|
||||
@@ -26,8 +26,6 @@ class Episode extends Model
|
||||
|
||||
protected string $orderDirection = 'ASC';
|
||||
|
||||
public $table = 'episodes';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Season, self>
|
||||
*/
|
||||
|
||||
@@ -24,8 +24,6 @@ class Genre extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'genres';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Movie>
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ class GuestStar extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'person';
|
||||
public $table = 'people';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Episode>
|
||||
|
||||
@@ -23,8 +23,6 @@ class Movie extends Model
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public $table = 'movie';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Genre>
|
||||
*/
|
||||
|
||||
@@ -24,8 +24,6 @@ class Network extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'networks';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Tv>
|
||||
*/
|
||||
|
||||
@@ -25,8 +25,6 @@ class Person extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'person';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Tv>
|
||||
*/
|
||||
|
||||
@@ -22,13 +22,6 @@ class PersonalFreeleech extends Model
|
||||
use Auditable;
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'personal_freeleech';
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
|
||||
@@ -24,8 +24,6 @@ class Season extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $table = 'seasons';
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
*
|
||||
|
||||
@@ -24,13 +24,6 @@ class Seedbox extends Model
|
||||
use Encryptable;
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'clients';
|
||||
|
||||
/**
|
||||
* The Attributes That Are Encrypted.
|
||||
*
|
||||
|
||||
@@ -27,13 +27,6 @@ class UserEcho extends Model
|
||||
*/
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'user_echoes';
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
*
|
||||
|
||||
16
database/migrations/2023_12_22_221619_plural_table_names.php
Normal file
16
database/migrations/2023_12_22_221619_plural_table_names.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::rename('bon_exchange', 'bon_exchanges');
|
||||
Schema::rename('collection', 'collections');
|
||||
Schema::rename('movie', 'movies');
|
||||
Schema::rename('person', 'people');
|
||||
Schema::rename('personal_freeleech', 'personal_freeleeches');
|
||||
Schema::rename('clients', 'seedboxes');
|
||||
}
|
||||
};
|
||||
@@ -32,7 +32,7 @@ test('rules', function (): void {
|
||||
'exchange' => [
|
||||
'bail',
|
||||
'required',
|
||||
'exists:bon_exchange,id',
|
||||
'exists:bon_exchanges,id',
|
||||
],
|
||||
], $actual);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user