blue-twilight/database/migrations/2017_04_16_095657_attach_hit_columns.php

43 lines
957 B
PHP
Raw Normal View History

<?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) {
$table->bigInteger('hits_download');
$table->dropColumn('hits');
});
Schema::table('albums', function (Blueprint $table) {
$table->dropColumn('hits');
});
}
}