mirror of
https://github.com/flarum/core.git
synced 2025-05-29 18:51:19 +02:00
Implemented our own migration repository + migrator (based on Laravel's stuff) so that we can keep track of which migrations have been run for core and per-extension. That way we can simple call the migrator to upgrade core/extensions, and to uninstall extensions.
40 lines
1011 B
PHP
40 lines
1011 B
PHP
<?php
|
|
|
|
use Flarum\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateNotificationsTable extends Migration
|
|
{
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
$this->schema->create('notifications', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->integer('user_id')->unsigned();
|
|
$table->integer('sender_id')->unsigned()->nullable();
|
|
$table->string('type', 100);
|
|
$table->string('subject_type', 200)->nullable();
|
|
$table->integer('subject_id')->unsigned()->nullable();
|
|
$table->binary('data')->nullable();
|
|
$table->dateTime('time');
|
|
$table->boolean('is_read')->default(0);
|
|
$table->boolean('is_deleted')->default(0);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
$this->schema->drop('notifications');
|
|
}
|
|
}
|