14 use Illuminate\Database\Migrations\Migration;
15 use Illuminate\Database\Schema\Builder;
16 use Illuminate\Database\Schema\Blueprint;
17 use Illuminate\Database\Capsule\Manager as Capsule;
24 public function up() {
25 Capsule::schema()->create(
'notes',
function (Blueprint $table) {
26 $table->bigInteger(
'note_id')->autoIncrement();
27 $table->bigInteger(
'assoc_type');
28 $table->bigInteger(
'assoc_id');
29 $table->bigInteger(
'user_id');
30 $table->datetime(
'date_created');
31 $table->datetime(
'date_modified')->nullable();
32 $table->string(
'title', 255)->nullable();
33 $table->text(
'contents')->nullable();
34 $table->index([
'assoc_type',
'assoc_id'],
'notes_assoc');
43 Capsule::schema()->drop(
'notes');