mirror of
https://github.com/flarum/framework.git
synced 2025-03-03 03:05:25 +08:00
Fix migrations to comply with PSR-2
This commit is contained in:
parent
803d446bbb
commit
fc20c0dd09
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAccessTokensTable extends Migration {
|
||||
class CreateAccessTokensTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateAccessTokensTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('access_tokens', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('access_tokens', function (Blueprint $table) {
|
||||
|
||||
$table->string('id', 100)->primary();
|
||||
$table->integer('user_id')->unsigned();
|
||||
});
|
||||
@ -28,5 +29,4 @@ class CreateAccessTokensTable extends Migration {
|
||||
{
|
||||
Schema::drop('access_tokens');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateActivityTable extends Migration {
|
||||
class CreateActivityTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateActivityTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('activity', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('activity', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('sender_id')->unsigned()->nullable();
|
||||
@ -32,5 +33,4 @@ class CreateActivityTable extends Migration {
|
||||
{
|
||||
Schema::drop('activity');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateConfigTable extends Migration {
|
||||
class CreateConfigTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateConfigTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('config', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('config', function (Blueprint $table) {
|
||||
|
||||
$table->string('key', 100)->primary();
|
||||
$table->binary('value')->nullable();
|
||||
});
|
||||
@ -28,5 +29,4 @@ class CreateConfigTable extends Migration {
|
||||
{
|
||||
Schema::drop('config');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDiscussionsTable extends Migration {
|
||||
class CreateDiscussionsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateDiscussionsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('discussions', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('discussions', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->string('title', 200);
|
||||
$table->integer('comments_count')->unsigned()->default(0);
|
||||
@ -39,5 +40,4 @@ class CreateDiscussionsTable extends Migration {
|
||||
{
|
||||
Schema::drop('discussions');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateNotificationsTable extends Migration {
|
||||
class CreateNotificationsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateNotificationsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('notifications', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('sender_id')->unsigned()->nullable();
|
||||
@ -35,5 +36,4 @@ class CreateNotificationsTable extends Migration {
|
||||
{
|
||||
Schema::drop('notifications');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePermissionsTable extends Migration {
|
||||
class CreatePermissionsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreatePermissionsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('permissions', function($table)
|
||||
{
|
||||
Schema::create('permissions', function ($table) {
|
||||
|
||||
$table->integer('group_id')->unsigned();
|
||||
$table->string('permission', 100);
|
||||
$table->primary(['group_id', 'permission']);
|
||||
@ -29,5 +30,4 @@ class CreatePermissionsTable extends Migration {
|
||||
{
|
||||
Schema::drop('permissions');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePostsTable extends Migration {
|
||||
class CreatePostsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreatePostsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('posts', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('posts', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->integer('discussion_id')->unsigned();
|
||||
$table->integer('number')->unsigned()->nullable();
|
||||
@ -43,5 +44,4 @@ class CreatePostsTable extends Migration {
|
||||
{
|
||||
Schema::drop('posts');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUsersDiscussionsTable extends Migration {
|
||||
class CreateUsersDiscussionsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateUsersDiscussionsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users_discussions', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('users_discussions', function (Blueprint $table) {
|
||||
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('discussion_id')->unsigned();
|
||||
$table->dateTime('read_time')->nullable();
|
||||
@ -31,5 +32,4 @@ class CreateUsersDiscussionsTable extends Migration {
|
||||
{
|
||||
Schema::drop('users_discussions');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUsersGroupsTable extends Migration {
|
||||
class CreateUsersGroupsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateUsersGroupsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users_groups', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('users_groups', function (Blueprint $table) {
|
||||
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('group_id')->unsigned();
|
||||
$table->primary(['user_id', 'group_id']);
|
||||
@ -29,5 +30,4 @@ class CreateUsersGroupsTable extends Migration {
|
||||
{
|
||||
Schema::drop('users_groups');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUsersTable extends Migration {
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -12,8 +13,8 @@ class CreateUsersTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
$table->string('username', 100)->unique();
|
||||
$table->string('email', 150)->unique();
|
||||
@ -43,5 +44,4 @@ class CreateUsersTable extends Migration {
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user