aboutsummaryrefslogtreecommitdiffhomepage
path: root/database
diff options
context:
space:
mode:
authorMarvin Borner2018-07-08 17:14:26 +0200
committerMarvin Borner2018-07-08 17:14:26 +0200
commit2b7e31ffa79f508453bc5c759a7511e476cbbe96 (patch)
tree209ea7974323b0b9270090f4f993ffb1a77085bd /database
parent8ba38dcf7fbd96a6f13639057e045eba114e2f39 (diff)
Added basic blockchain-like hashing for verified data
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2014_10_12_000000_create_users_table.php1
-rw-r--r--database/migrations/2018_07_07_104937_create_public_keys_table.php2
-rw-r--r--database/seeds/DatabaseSeeder.php16
3 files changed, 17 insertions, 2 deletions
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index 6751167..55e1804 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -18,6 +18,7 @@ class CreateUsersTable extends Migration
$table->string('email')->unique();
$table->string('password');
$table->string('avatar')->default('0.png');
+ $table->string('hash', 60)->unique();
$table->rememberToken();
$table->timestamps();
});
diff --git a/database/migrations/2018_07_07_104937_create_public_keys_table.php b/database/migrations/2018_07_07_104937_create_public_keys_table.php
index 5a1dda4..c9d548e 100644
--- a/database/migrations/2018_07_07_104937_create_public_keys_table.php
+++ b/database/migrations/2018_07_07_104937_create_public_keys_table.php
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
-class CreatePublicKeyTable extends Migration
+class CreatePublicKeysTable extends Migration
{
/**
* Run the migrations.
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index 91cb6d1..db0f2fd 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -1,6 +1,7 @@
<?php
use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
class DatabaseSeeder extends Seeder
{
@@ -11,6 +12,19 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
- // $this->call(UsersTableSeeder::class);
+ DB::table('users')->insert([
+ 'id' => 0,
+ 'name' => 'genesis',
+ 'email' => ' ',
+ 'password' => ' ',
+ 'hash' => bcrypt('genesis')
+ ]);
+
+ DB::table('users')->insert([
+ 'name' => 'Marvin Borner',
+ 'email' => 'marvin@borners.de',
+ 'password' => bcrypt('password'),
+ 'hash' => bcrypt(bcrypt('genesis') . 'Marvin Borner'. 'marvin@borners.de'. 'password') // hashing: prev hash, all fields in current 'block'
+ ]);
}
}