mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 11:13:27 +02:00
Feature migrations up/down (#270)
* Migrations up down * Add forum model * Syntactic sugar for db structure changes * Refactor migrations with $up & $down * Fix migrations upgrade and downgrade + Add option to disable auto migrate * Add migrate:to command Usage: php aac migrate:to x (x - database version) * Show error when mail is not enabled * Fixes regarding to init.php * Add migrate command to manually upgrade db, incase auto migrate is disabled * Fixed rest of the migrations * Limit max version of database * Don't allow minus number * Option to clear specified plugin settings by name * Version is required * Fix PHPStan errors * Unset $up after migration, to prevent executing same migration twice * Add database version to output * This is not needed * Update 5.php * Set database_auto_migrate on install * Set blank & color only if current db version supports it * Fix duplicate function declaration
This commit is contained in:
30
system/src/Models/Forum.php
Normal file
30
system/src/Models/Forum.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace MyAAC\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Forum extends Model
|
||||
{
|
||||
protected $table = TABLE_PREFIX . 'forum';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = ['first_post', 'last_post', 'section', 'replies', 'views', 'author_aid', 'author_guid', 'post_text', 'post_topic', 'post_smile', 'post_html', 'post_date', 'last_edit_aid', 'edit_date', 'post_ip', 'sticked', 'closed'];
|
||||
|
||||
protected $casts = [
|
||||
'first_post' => 'integer',
|
||||
'last_post' => 'integer',
|
||||
'section' => 'integer',
|
||||
'replies' => 'integer',
|
||||
'views' => 'integer',
|
||||
'author_aid' => 'integer',
|
||||
'author_guid' => 'integer',
|
||||
'post_smile' => 'boolean',
|
||||
'post_html' => 'boolean',
|
||||
'post_date' => 'integer',
|
||||
'last_edit_aid' => 'integer',
|
||||
'edit_date' => 'integer',
|
||||
'sticked' => 'boolean',
|
||||
'closed' => 'boolean'
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user