List existing organisations
This commit is contained in:
56
src/Database/Migrations/v001/OrganisationsTable.php
Normal file
56
src/Database/Migrations/v001/OrganisationsTable.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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\v001;
|
||||
|
||||
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
|
||||
* "Organisations" are intended to replace groups by providing logical grouping where users may be in none or more organisations.
|
||||
* Version 1.0.0.
|
||||
*
|
||||
* @author Craig Williams (https://avsdev.uk)
|
||||
*/
|
||||
class OrganisationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!$this->schema->hasTable('organisations')) {
|
||||
$this->schema->create('organisations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('slug');
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
$table->engine = 'InnoDB';
|
||||
$table->collation = 'utf8_unicode_ci';
|
||||
$table->charset = 'utf8';
|
||||
$table->unique('slug');
|
||||
$table->index('slug');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->schema->drop('organisations');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user