Created
June 2, 2014 19:52
-
-
Save that0n3guy/1dc690374767dceba3cb to your computer and use it in GitHub Desktop.
contacts and lists update (migration) files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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