Skip to content

Instantly share code, notes, and snippets.

@that0n3guy
Created June 2, 2014 19:52
Show Gist options
  • Save that0n3guy/1dc690374767dceba3cb to your computer and use it in GitHub Desktop.
Save that0n3guy/1dc690374767dceba3cb to your computer and use it in GitHub Desktop.
contacts and lists update (migration) files
<?php namespace OCA\Blasts\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class CreateContactsTable extends Migration
{
public function up()
{
Schema::create('oca_blasts_contacts', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('firstname');
$table->string('lastname');
$table->string('name');
$table->string('email');
$table->string('phone');
$table->boolean('active');
$table->timestamps();
});
}
public function down()
{
Schema::drop('oca_blasts_contacts');
}
}
<?php namespace OCA\Blasts\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class CreateOcalistsTable extends Migration
{
public function up()
{
Schema::create('oca_blasts_ocalists', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table->timestamps();
});
Schema::create('oca_blasts_ocalistables', function($table)
{
$table->engine = 'InnoDB';
$table->integer('ocalist_id');
$table->integer('ocalistable_id');
$table->string('ocalistable_type');
$table->timestamps();
});
}
public function down()
{
Schema::drop('oca_blasts_ocalists');
Schema::drop('oca_blasts_ocalistables');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment