65 lines
1.9 KiB
PHP
65 lines
1.9 KiB
PHP
<?php
|
|
|
|
/*
|
|
* AVSDev UF Organisations (https://avsdev.uk)
|
|
*
|
|
* @link https://git.avsdev.uk/avsdev/sprinkle-organisations
|
|
* @license https://git.avsdev.uk/avsdev/sprinkle-organisations/blob/master/LICENSE.md (LGPL-3.0 License)
|
|
*/
|
|
|
|
namespace UserFrosting\Sprinkle\Organisations\Database\Migrations\v1_0_0;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use UserFrosting\Sprinkle\Core\Database\Migration;
|
|
|
|
/**
|
|
* Organisation Membership Approvals table migration
|
|
* Manages requests for organisation membership join requests.
|
|
* Version 1.0.0.
|
|
*
|
|
* @author Craig Williams (https://avsdev.uk)
|
|
*/
|
|
class OrganisationMembershipApprovalsTable extends Migration
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static $dependencies = [
|
|
'\UserFrosting\Sprinkle\Account\Database\Migrations\v430\UpdateUsersTable',
|
|
];
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function up()
|
|
{
|
|
if (!$this->schema->hasTable('organisation_membership_approvals')) {
|
|
$this->schema->create('organisation_membership_approvals', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->integer('owner_id')->unsigned();
|
|
$table->string('hash');
|
|
$table->boolean('completed')->default(0);
|
|
$table->timestamp('expires_at')->nullable();
|
|
$table->timestamp('completed_at')->nullable();
|
|
$table->integer('approver_id')->unsigned()->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->engine = 'InnoDB';
|
|
$table->collation = 'utf8_unicode_ci';
|
|
$table->charset = 'utf8';
|
|
$table->foreign('approver_id')->references('id')->on('users');
|
|
$table->index('owner_id');
|
|
$table->index('hash');
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function down()
|
|
{
|
|
$this->schema->drop('organisation_membership_approvals');
|
|
}
|
|
}
|