2017-04-16 10:04:47 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class AttachHitColumns extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::table('albums', function (Blueprint $table) {
|
|
|
|
$table->bigInteger('hits');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('photos', function (Blueprint $table) {
|
|
|
|
$table->bigInteger('hits');
|
|
|
|
$table->bigInteger('hits_download');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('photos', function (Blueprint $table) {
|
2017-04-17 15:45:25 +01:00
|
|
|
$table->dropColumn('hits_download');
|
2017-04-16 10:04:47 +01:00
|
|
|
$table->dropColumn('hits');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('albums', function (Blueprint $table) {
|
|
|
|
$table->dropColumn('hits');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|