Added an approved flag to organisations with a status column as an indicator, pending registration/approval workflow

This commit is contained in:
2022-02-10 12:51:29 +00:00
parent a42b04f518
commit 6570f2fb27
6 changed files with 150 additions and 5 deletions

View File

@@ -0,0 +1,55 @@
<?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\v002;
use Illuminate\Database\Schema\Blueprint;
use UserFrosting\Sprinkle\Organisations\Database\Models\Organisation;
use UserFrosting\Sprinkle\Core\Database\Migration;
use UserFrosting\Sprinkle\Core\Facades\Seeder;
/**
* Organisations table migration
* Adds a `flag_verified` column to the `organisations` table
* Version 1.0.0.
*
* @author Craig Williams (https://avsdev.uk)
*/
class UpdateOrganisationsTable extends Migration
{
/**
* {@inheritdoc}
*/
public static $dependencies = [
'\UserFrosting\Sprinkle\Account\Database\Migrations\v400\UsersTable',
'\UserFrosting\Sprinkle\Organisations\Database\Migrations\v001\OrganisationsTable',
];
/**
* {@inheritdoc}
*/
public function up()
{
if ($this->schema->hasTable('organisations')) {
$this->schema->table('organisations', function (Blueprint $table) {
$table->boolean('flag_approved')->default(1)->comment('Set to 1 if the organisation has been approved, 0 otherwise.');
});
}
}
/**
* {@inheritdoc}
*/
public function down()
{
$this->schema->table('organisations', function (Blueprint $table) {
$table->dropColumn('flag_verified');
});
}
}