56 lines
1.5 KiB
PHP
56 lines
1.5 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\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_approved');
|
|
});
|
|
}
|
|
}
|