some more cleanup for migrations

This commit is contained in:
Nabeel Shahzad
2017-06-20 22:48:16 -05:00
parent c27a11ab21
commit 807316fd0e
7 changed files with 71 additions and 104 deletions

View File

@@ -7,40 +7,40 @@ use Illuminate\Support\Facades\Config;
class CreateSettingsTable extends Migration
{
public function __construct()
{
public function __construct()
{
$this->tablename = Config::get('settings.table');
$this->keyColumn = Config::get('settings.keyColumn');
$this->valueColumn = Config::get('settings.valueColumn');
}
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create($this->tablename, function(Blueprint $table)
{
$table->increments('id');
$table->string($this->keyColumn)->index();
$table->text($this->valueColumn);
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create($this->tablename, function (Blueprint $table) {
$table->increments('id');
$table->string($this->keyColumn)->index();
$table->text($this->valueColumn);
$table->timestamps();
});
});
Setting::set('timezone', 'UTC');
Setting::set('currency', 'dollar');
Setting::save();
}
#Setting::set('currency', 'dollar');
#Setting::set('currency_descrip', 'Currency to use');
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop($this->tablename);
}
#Setting::save();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop($this->tablename);
}
}

View File

@@ -27,6 +27,7 @@ class CreateUsersTable extends Migration
$table->boolean('confirmed')->nullable();
$table->boolean('retired')->nullable();
$table->dateTime('last_pirep')->nullable();
$table->integer('timezone')->default(0);
$table->rememberToken();
$table->timestamps();
});