Skip to content

Commit

Permalink
Added userCurerent() function to the schema builder for all sockets a…
Browse files Browse the repository at this point in the history
…nd wrench tables so they will be created with current_timestamp() defaults, which allows for automaticallly setting current timestamp on create even when laravel models are not used (#129)
  • Loading branch information
kchapple committed Jul 23, 2020
1 parent 4a588ac commit ba6a84c
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function up()
$table->string('socket_label', 1024);
$table->boolean( 'is_default_socket' );
$table->integer( 'socketsource_id');
$table->timestamps();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
//
// CREATE TABLE `socketsource` (
Expand All @@ -45,7 +46,8 @@ public function up()
Schema::create('socketsource', function (Blueprint $table) {
$table->increments('id');
$table->string( 'socketsource_name', 1024 );
$table->timestamps();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
//
// CREATE TABLE `socket_user` (
Expand All @@ -62,7 +64,8 @@ public function up()
$table->integer('user_id');
$table->integer('wrench_id');
$table->integer('current_chosen_socket_id');
$table->timestamps();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});

//
Expand All @@ -78,9 +81,10 @@ public function up()
$table->increments('id');
$table->string( 'wrench_lookup_string', 200 );
$table->string( 'wrench_label', 200 );
$table->timestamps();
$table->unique('wrench_label');
$table->unique('wrench_lookup_string');
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
$table->unique('wrench_label');
$table->unique('wrench_lookup_string');
});
}

Expand Down

0 comments on commit ba6a84c

Please sign in to comment.