-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lambda default Migration & Seeder updated
- Loading branch information
Ariunbold Boldbaatar
authored and
Ariunbold Boldbaatar
committed
Mar 2, 2021
1 parent
6863cac
commit 30c6242
Showing
6 changed files
with
190 additions
and
105 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
database/migrations/2014_10_12_000000_create_users_table.php
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
database/migrations/2014_10_12_100000_create_password_resets_table.php
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
database/migrations/2019_08_19_000000_create_failed_jobs_table.php
This file was deleted.
Oops, something went wrong.
120 changes: 120 additions & 0 deletions
120
database/migrations/2021_03_02_112708_create_lambda_setup_tables.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateLambdaSetupTables extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// Create table for storing Password resets | ||
Schema::create('password_resets', function (Blueprint $table) { | ||
$table->string('email')->primary(); | ||
$table->string('token'); | ||
$table->integer('wrong'); | ||
$table->timestamp('created_at')->nullable(); | ||
}); | ||
|
||
// Create table for storing Roles | ||
Schema::create('roles', function (Blueprint $table) { | ||
$table->id()->autoIncrement(); | ||
$table->string('name', 100)->unique(); | ||
$table->string('display_name', 100); | ||
$table->string('description', 255)->nullable($value = true); | ||
$table->text('permissions')->nullable($value = true); | ||
$table->text('extra')->nullable($value = true); | ||
$table->string('menu')->nullable($value = true); | ||
$table->timestamp('created_at')->useCurrent()->nullable($value = true); | ||
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate()->nullable($value = true); | ||
$table->softDeletes($column = 'deleted_at', $precision = 0); | ||
}); | ||
|
||
// Create table for storing Users | ||
Schema::create('users', function (Blueprint $table) { | ||
$table->bigInteger('id', 1); | ||
$table->string('login', 255)->unique(); | ||
$table->string('password', 255); | ||
$table->bigInteger('role'); | ||
$table->string('first_name', 80)->nullable($value = true); | ||
$table->string('last_name', 80)->nullable($value = true); | ||
$table->string('email', 255)->unique(); | ||
$table->string('register_number', 80)->unique(); | ||
$table->text('avatar')->nullable($value = true); | ||
$table->text('bio')->nullable($value = true); | ||
$table->date('birthday')->nullable($value = true); | ||
$table->string('phone', 80)->nullable($value = true); | ||
$table->string('gender', 255)->nullable($value = true); | ||
$table->string('fcm_token', 255)->nullable($value = true); | ||
$table->string('status', 255); | ||
$table->rememberToken(); | ||
$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); | ||
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); | ||
$table->softDeletes($column = 'deleted_at', $precision = 0); | ||
}); | ||
|
||
// Create table for storing Krud | ||
Schema::create('krud', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('title')->nullable($value = true); | ||
$table->integer('form')->nullable($value = true); | ||
$table->integer('grid')->nullable($value = true); | ||
$table->string('template')->nullable($value = true); | ||
$table->string('actions')->nullable($value = true); | ||
$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); | ||
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); | ||
$table->softDeletes($column = 'deleted_at', $precision = 0); | ||
}); | ||
|
||
// Create table for storing Krud Templates | ||
Schema::create('krud_templates', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('template_name')->nullable($value = true); | ||
$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); | ||
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); | ||
$table->softDeletes($column = 'deleted_at', $precision = 0); | ||
}); | ||
|
||
// Create table for storing vb_schemas | ||
Schema::create('vb_schemas', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name')->nullable($value = true); | ||
$table->text('schema')->nullable($value = true); | ||
$table->string('type')->nullable($value = true); | ||
$table->timestamps(); | ||
}); | ||
|
||
// Create table for storing vb_schemas_admin | ||
Schema::create('vb_schemas_admin', function (Blueprint $table) { | ||
$table->unsignedInteger('vb_id', 1); | ||
$table->string('name')->nullable($value = true); | ||
$table->longText('schema')->nullable($value = true); | ||
$table->string('type')->nullable($value = true); | ||
$table->string('id')->nullable($value = true); | ||
$table->dateTime('created_at', $precision = 0)->nullable($value = true); | ||
$table->dateTime('updated_at', $precision = 0)->nullable($value = true); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('password_resets'); | ||
Schema::dropIfExists('roles'); | ||
Schema::dropIfExists('users'); | ||
Schema::dropIfExists('krud'); | ||
Schema::dropIfExists('krud_templates'); | ||
Schema::dropIfExists('vb_schemas'); | ||
Schema::dropIfExists('vb_schemas_admin'); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.