Last active
November 11, 2017 00:52
-
-
Save abdullahseba/d969c45bf9c12844b7cad51122c89f4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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