mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
Update for composer branch
This commit is contained in:
@@ -8,18 +8,13 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Migrations\Likes;
|
||||
namespace Flarum\Likes\Migration;
|
||||
|
||||
use Flarum\Database\AbstractMigration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Flarum\Migrations\Migration;
|
||||
|
||||
class CreatePostsLikesTable extends Migration
|
||||
class CreatePostsLikesTable extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->schema->create('posts_likes', function (Blueprint $table) {
|
||||
@@ -29,11 +24,6 @@ class CreatePostsLikesTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->schema->drop('posts_likes');
|
||||
|
@@ -8,20 +8,14 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Migrations\Likes;
|
||||
namespace Flarum\Likes\Migration;
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Flarum\Migrations\Migration;
|
||||
use Flarum\Core\Groups\Group;
|
||||
use Flarum\Core\Groups\Permission;
|
||||
use Flarum\Core\Group;
|
||||
use Flarum\Core\Permission;
|
||||
use Flarum\Database\AbstractMigration;
|
||||
|
||||
class AddDefaultLikePermissions extends Migration
|
||||
class AddDefaultLikePermissions extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Permission::unguard();
|
||||
@@ -31,16 +25,14 @@ class AddDefaultLikePermissions extends Migration
|
||||
$permission->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Permission::where($this->getPermissionAttributes())->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getPermissionAttributes()
|
||||
{
|
||||
return [
|
||||
|
Reference in New Issue
Block a user