Skip to content

Instantly share code, notes, and snippets.

@abdullahseba
Last active November 11, 2017 00:52
Show Gist options
  • Save abdullahseba/d969c45bf9c12844b7cad51122c89f4e to your computer and use it in GitHub Desktop.
Save abdullahseba/d969c45bf9c12844b7cad51122c89f4e to your computer and use it in GitHub Desktop.
<?php
/**
*Modules table migration
*
* @author Abdullah Seba
* @link example.comn
*
* @version 1.0.0
*
*/
namespace UserFrosting\Sprinkle\HacKit\Database\Migrations\v100;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use UserFrosting\System\Bakery\Migration;
/**
* Stores a list of modules
* @extends Migration
*/
class ModulesTable extends Migration
{
/**
* Creates Modules table
*/
public function up()
{
if (!$this->schema->hasTable('modules')) {
$this->schema->create('modules', function (Blueprint $table) {
$table->increments('id')->unique();
$table->string('name', 20)->unique();
$table->string('discription', 255);
$table->string('author', 20);
$table->string('version', 5);
$table->boolean('enabled');
$table->boolean('trusted');
$table->timestamps();
$table->engine = 'InnoDB';
$table->collation = 'utf8_unicode_ci';
$table->charset = 'utf8';
});
}
}
/**
* Drops Modules Table
*/
public function down()
{
$this->schema->drop('modules');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment