migrations

This commit is contained in:
merdan 2019-11-23 15:55:46 +05:00
parent ef3a76500d
commit 6bd3424431
3 changed files with 38 additions and 12 deletions

View File

@ -6,11 +6,11 @@ APP_KEY=
APP_TIMEZONE=
DB_TYPE=mysql
DB_HOST=db
DB_PORT=3306
DB_HOST=localhost
DB_PORT=8889
DB_DATABASE=attendize
DB_USERNAME=attendize
DB_PASSWORD=attendize
DB_USERNAME=root
DB_PASSWORD=root
DEFAULT_DATEPICKER_SEPERATOR="-"
DEFAULT_DATEPICKER_FORMAT="yyyy-MM-dd HH:mm"

View File

@ -33,10 +33,6 @@ class CreateVenuesTable extends Migration
$t->json('address')->nullable();
});
Schema::table('events', function (Blueprint $table) {
$table->integer('venue_id')->nullable();
$table->foreign('venue_id')->references('id')->on('venues');
});
}
/**
@ -46,10 +42,6 @@ class CreateVenuesTable extends Migration
*/
public function down()
{
Schema::table('events', function (Blueprint $table){
$table->dropForeign('venue_id');
$table->dropColumn('venue_id');
});
Schema::dropIfExists('venues');
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddVenueToEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('events', function (Blueprint $table) {
$table->integer('venue_id')->nullable();
$table->foreign('venue_id')->references('id')->on('venues');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('events', function (Blueprint $table) {
$table->dropForeign('venue_id');
$table->dropColumn('venue_id');
});
}
}