Skip to content

Commit

Permalink
merge migrations :danger!
Browse files Browse the repository at this point in the history
  • Loading branch information
phecho committed Jun 24, 2016
1 parent ac6d6cc commit 38b62fd
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 290 deletions.
4 changes: 2 additions & 2 deletions app/Services/Notifier/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public function notify($type, User $author, User $toUser, $object = null)
$data = [
'author_id' => $author->id,
'user_id' => $toUser->id,
'body' => isset($object) ? $object->body : '',
'body' => isset($object) && isset($object->body) ? $object->body : '',
'type' => $type,
'created_at' => $nowTimestamp,
'updated_at' => $nowTimestamp,
];

$toUser->increment('notification_count', 1);

$object->notifications()->insert([$data]);
$object->notifications()->create($data);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function up()
$table->increments('id');
$table->string('name');
$table->integer('adspace_id');
$table->boolean('enabled')->default(true);
$table->text('body');
$table->timestamps();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->increments('id');
$table->integer('from_user_id');
$table->integer('author_id');
$table->integer('user_id');
$table->integer('thread_id');
$table->integer('reply_id')->nullable();
$table->text('body')->nullable();
$table->integer('object_id');
$table->string('object_type');
$table->string('type');
$table->text('body')->nullable();
$table->timestamps();

$table->index('from_user_id');
$table->index('author_id');
$table->index('user_id');
$table->index('thread_id');
$table->index('reply_id');
$table->index('object_id');
$table->index('object_type');
$table->index('type');
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function up()
$table->timestamps();

$table->index('name');
$table->index('order');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function up()
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->text('desctiption');
$table->timestamps();

$table->unique('slug');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function up()
$table->timestamps();

$table->unique('name');
$table->index('order');
});
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ public function up()
$table->integer('user_id');
$table->integer('rule_id');
$table->integer('balance');
$table->string('frequency_tag')->nullable();
$table->text('body')->nullable();
$table->timestamps();

$table->index('user_id');
$table->index('rule_id');
$table->index('frequency_tag');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function up()
$table->increments('id');
$table->string('name');
$table->string('slug')->nullable();
$table->integer('frequency')->unsigned()->default(0);
$table->integer('reward')->default(0);
$table->timestamps();

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 38b62fd

Please sign in to comment.