Initial commit
This commit is contained in:
1
database/.gitignore
vendored
Normal file
1
database/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.sqlite*
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
if (version_compare(Application::VERSION, '5.0', '>=')) {
|
||||
$this->tablename = Config::get('settings.table');
|
||||
$this->keyColumn = Config::get('settings.keyColumn');
|
||||
$this->valueColumn = Config::get('settings.valueColumn');
|
||||
} else {
|
||||
$this->tablename = Config::get('anlutro/l4-settings::table');
|
||||
$this->keyColumn = Config::get('anlutro/l4-settings::keyColumn');
|
||||
$this->valueColumn = Config::get('anlutro/l4-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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop($this->tablename);
|
||||
}
|
||||
}
|
20
database/seeders/DatabaseSeeder.php
Normal file
20
database/seeders/DatabaseSeeder.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\Usermanager\Database\Seeders\UsersSeeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user