w0bm.com v1.5z FULL.RETARD.BUILD.BUT.STILL.WORKS
This commit is contained in:
0
database/migrations/.gitkeep
Normal file
0
database/migrations/.gitkeep
Normal file
100
database/migrations/2015_03_20_193906_verify_init.php
Normal file
100
database/migrations/2015_03_20_193906_verify_init.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class VerifyInit extends Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->prefix = Config::get('verify.prefix', '');
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$prefix = $this->prefix;
|
||||
|
||||
Schema::create($prefix . 'permissions', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->increments('id');
|
||||
$table->string('name', 100)->index();
|
||||
$table->string('description', 255)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create($prefix . 'roles', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->increments('id');
|
||||
$table->string('name', 100)->index();
|
||||
$table->string('description', 255)->nullable();
|
||||
$table->integer('level');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create($prefix . 'users', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->increments('id');
|
||||
$table->string('username', 30)->index();
|
||||
$table->string('password', 60)->index();
|
||||
$table->string('salt', 32);
|
||||
$table->string('email', 255)->index();
|
||||
$table->string('remember_token', 100)->nullable()->index();
|
||||
$table->boolean('verified')->default(0);
|
||||
$table->boolean('disabled')->default(0);
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create($prefix . 'role_user', function($table) use ($prefix)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->integer('user_id')->unsigned()->index();
|
||||
$table->integer('role_id')->unsigned()->index();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')
|
||||
->references('id')
|
||||
->on($prefix . 'users')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('role_id')
|
||||
->references('id')
|
||||
->on($prefix . 'roles')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create($prefix . 'permission_role', function($table) use ($prefix)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->integer('permission_id')->unsigned()->index();
|
||||
$table->integer('role_id')->unsigned()->index();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('permission_id')
|
||||
->references('id')
|
||||
->on($prefix . 'permissions')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('role_id')
|
||||
->references('id')
|
||||
->on($prefix . 'roles')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::drop($this->prefix . 'role_user');
|
||||
Schema::drop($this->prefix . 'permission_role');
|
||||
Schema::drop($this->prefix . 'users');
|
||||
Schema::drop($this->prefix . 'roles');
|
||||
Schema::drop($this->prefix . 'permissions');
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateVideosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('videos', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('file')->unique();
|
||||
$table->string('interpret')->nullable();
|
||||
$table->string('songtitle')->nullable();
|
||||
$table->string('imgsource')->nullable();
|
||||
$table->unsignedInteger('category_id');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('videos');
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCategoriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('categories', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('shortname')->unique();
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('categories');
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCommentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('comments', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->text('content');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('video_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('comments');
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddHashToVideosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('videos', function(Blueprint $table) {
|
||||
$table->char('hash', 40)->default('');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('videos', function(Blueprint $table) {
|
||||
$table->dropColumn('hash');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddActivationTokenToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->string('activation_token', 50)->nullable()->index()->after('remember_token');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->dropColumn('activation_token');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateModeratorLogTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('moderator_logs', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->string('type');
|
||||
$table->string('target_type');
|
||||
$table->unsignedInteger('target_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('moderator_logs');
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddBackgroundToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->boolean('background')->default(true)->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->dropColumn('background');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUserVideoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('favorites', function(Blueprint $table) {
|
||||
$table->unsignedInteger('user_id')->index();
|
||||
$table->unsignedInteger('video_id')->index();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->foreign('video_id')->references('id')->on('videos')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('favorites');
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateMessagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
\Illuminate\Support\Facades\Schema::create('messages', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('from')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
|
||||
$table->unsignedInteger('to')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
|
||||
$table->text('content');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
\Illuminate\Support\Facades\Schema::drop('messages');
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddReadFieldToMessagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('messages', function(Blueprint $table) {
|
||||
$table->timestamp('read')->nullable();
|
||||
$table->string('subject')->default('');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('messages', function(Blueprint $table) {
|
||||
$table->dropColumn(['read', 'subject']);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddsCategoriesFieldToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->json('categories')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('categories');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddBanningToUserTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('banreason')->nullable();
|
||||
$table->timestamp('banend')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn(['banreason', 'banend']);
|
||||
});
|
||||
}
|
||||
}
|
55
database/migrations/2016_09_22_092717_add_icons.php
Normal file
55
database/migrations/2016_09_22_092717_add_icons.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddIcons extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('icons', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('icon', 255);
|
||||
$table->string('icon_type', 255);
|
||||
});
|
||||
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->unsignedInteger('icon_id')->index()->nullable();
|
||||
$table->foreign('icon_id')
|
||||
->references('id')
|
||||
->on('icons')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::table('roles', function(Blueprint $table) {
|
||||
$table->unsignedInteger('icon_id')->index()->nullable();
|
||||
$table->foreign('icon_id')
|
||||
->references('id')
|
||||
->on('icons')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('icons');
|
||||
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->dropColumn('icon_id');
|
||||
});
|
||||
|
||||
Schema::table('roles', function(Blueprint $table) {
|
||||
$table->dropColumn('icon_id');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddReasonToModeratorLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('moderator_logs', function (Blueprint $table) {
|
||||
$table->string('reason')->nullable()->after('target_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('moderator_logs', function (Blueprint $table) {
|
||||
$table->dropColumn('reason');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
|
||||
class CreateTaggableTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('taggable_tags', function (Blueprint $table) {
|
||||
$table->increments('tag_id');
|
||||
$table->string('name');
|
||||
$table->string('normalized')->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('taggable_taggables', function (Blueprint $table) {
|
||||
$table->unsignedInteger('tag_id');
|
||||
$table->unsignedInteger('taggable_id');
|
||||
$table->string('taggable_type');
|
||||
$table->timestamps();
|
||||
$table->primary(['tag_id', 'taggable_id', 'taggable_type']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('taggable_tags');
|
||||
Schema::drop('taggable_taggables');
|
||||
}
|
||||
}
|
35
database/migrations/2017_01_04_113103_banners.php
Normal file
35
database/migrations/2017_01_04_113103_banners.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class Banners extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('banners', function(Blueprint $t) {
|
||||
$t->increments('id');
|
||||
$t->string('customer')->nullable();
|
||||
$t->string('url');
|
||||
$t->string('image');
|
||||
$t->boolean('sfw');
|
||||
$t->timestamp('until');
|
||||
$t->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('banners');
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveBackgroundFromUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->dropColumn('background');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function(Blueprint $table) {
|
||||
$table->boolean('background')->default(true)->after('email');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDonationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('donations', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable();
|
||||
$table->string('url')->nullable();
|
||||
$table->float('amount', 5, 2);
|
||||
$table->string('payment_method')->nullable();
|
||||
$table->timestamp('timestamp');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('donations');
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ChangeAmountTypeToDecimalInDonationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('donations', function(Blueprint $table) {
|
||||
$table->decimal('amount', 13, 4)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('donations', function(Blueprint $table) {
|
||||
$table->float('amount', 5, 2)->change();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class FixDefaultValuesInFavoritesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// raw sql because doctrine/dbal doesn't support the timestamp datatype
|
||||
DB::statement("
|
||||
ALTER TABLE favorites
|
||||
MODIFY COLUMN created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
MODIFY COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::statement("
|
||||
ALTER TABLE favorites
|
||||
MODIFY COLUMN created_at TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
MODIFY COLUMN updated_at TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'
|
||||
");
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddUniqueHashConstraintToVideosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('videos', function(Blueprint $table) {
|
||||
$table->unique('hash');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('videos', function(Blueprint $table) {
|
||||
$table->dropUnique('videos_hash_unique');
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddVideotitleColumnToVideoTable extends Migration
|
||||
{ /**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->string('videotitle')->nullable()->after('file');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropColumn('videotitle');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddLayoutColumnToUserTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->integer('layout')->unsigned()->default(1)->after('icon_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('layout');
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user