Reputation: 1785
I've tried:
public function up()
{
Schema::create('meetings', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('description');
$table->enum('category',[0,1,2,3,4])->index();
$table->unsignedInteger('owner_id');
$table->foreign('owner_id')->references('id')->on('users')->onDelete('cascade');
$table->dateTime('start_date');
$table->dateTime('end_date');
$table->timestamps();
});
DB::raw("ALTER TABLE meetings ADD COLUMN geolocation POINT");
}
But this does not seem to work.
Upvotes: 2
Views: 1225
Reputation: 9835
You should use statement
method:
DB::statement("ALTER TABLE meetings ADD COLUMN geolocation POINT");
Update
About the second question, you can access to database.php
file like this:
if (Config::get('database')['default'] === 'mysql'){
// mysql
}else if (Config::get('database')['default'] === 'pgsql'){
// PostgreSQL
}
Upvotes: 6