First push before 🥚

This commit is contained in:
Dane Everitt 2017-10-06 21:22:32 -05:00
parent 0b3c0f6d5a
commit 344c1a9885
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
11 changed files with 36 additions and 158 deletions

View file

@ -42,12 +42,16 @@ class RemoveDaemonSecretFromSubusersTable extends Migration
public function down()
{
Schema::table('subusers', function (Blueprint $table) {
$table->char('daemonSecret', 36)->after('server_id')->unique();
$table->char('daemonSecret', 36)->after('server_id');
});
$subusers = DB::table('subusers')->get();
$subusers->each(function ($subuser) {
DB::table('daemon_keys')->where('user_id', $subuser->user_id)->where('server_id', $subuser->server_id)->delete();
});
Schema::table('subusers', function (Blueprint $table) {
$table->unique('daemonSecret');
});
}
}