mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-26 22:14:18 +01:00
Database import tables on every install with "IF NOT EXISTS"
This fixed errors when one table is missing or is duplicated
This commit is contained in:
@@ -18,7 +18,16 @@ class Changelog extends Model {
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'body', 'type', 'where',
|
||||
'date', 'player_id', 'hide',
|
||||
];
|
||||
|
||||
public function scopeIsPublic($query) {
|
||||
$query->where('hide', '!=', 1);
|
||||
}
|
||||
|
||||
public function player() {
|
||||
return $this->belongsTo(Player::class);
|
||||
}
|
||||
}
|
||||
|
||||
16
system/src/Models/ForumBoard.php
Normal file
16
system/src/Models/ForumBoard.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace MyAAC\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ForumBoard extends Model {
|
||||
|
||||
protected $table = TABLE_PREFIX . 'forum_boards';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'description', 'ordering',
|
||||
'guild', 'access', 'closed', 'hide',
|
||||
];
|
||||
}
|
||||
@@ -10,4 +10,9 @@ class Gallery extends Model {
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'comment', 'image', 'thumb',
|
||||
'author', 'ordering', 'hide',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
15
system/src/Models/NewsCategory.php
Normal file
15
system/src/Models/NewsCategory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace MyAAC\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NewsCategory extends Model {
|
||||
|
||||
protected $table = TABLE_PREFIX . 'news_categories';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'description', 'icon_id', 'hide'
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user