Пример #1
0
 public function anyUpload(InterfaceFileStorage $userFileStorage, AmqpWrapper $amqpWrapper, Server $server, UploadEntity $uploadEntity)
 {
     /* @var \App\Components\UserFileStorage $userFileStorage */
     $responseVariables = ['uploadStatus' => false, 'storageErrors' => [], 'uploadEntities' => []];
     if ($this->request->isMethod('post') && $this->request->hasFile('file') && $this->request->file('file')->isValid()) {
         $tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tmp-user-files-to-storage' . DIRECTORY_SEPARATOR;
         $tmpFilePath = $tmpDir . $this->request->file('file')->getClientOriginalName();
         $this->request->file('file')->move($tmpDir, $this->request->file('file')->getClientOriginalName());
         $userFileStorage->setValidationRules($this->config->get('storage.userfile.validation'));
         $newStorageFile = $userFileStorage->addFile($tmpFilePath);
         if ($newStorageFile && !$userFileStorage->hasErrors()) {
             /* @var \SplFileInfo $newStorageFile */
             // AMQP send $newfile, to servers
             foreach ($server->all() as $server) {
                 if (count($server->configs) > 0) {
                     foreach ($server->configs as $config) {
                         // Send server and file info to upload queue task
                         $amqpWrapper->sendMessage($this->config->get('amqp.queues.uploader.upload'), json_encode(['file' => $newStorageFile->getRealPath(), 'url' => $server->scheme . '://' . $config->auth . '@' . $server->host . '/' . trim($config->path, '\\/')]));
                     }
                 } else {
                     // The server has no configuration
                     $amqpWrapper->sendMessage($this->config->get('amqp.queues.uploader.upload'), json_encode(['file' => $newStorageFile->getRealPath(), 'url' => $server->scheme . '://' . $server->host]));
                 }
             }
             $responseVariables['uploadStatus'] = true;
         } else {
             $responseVariables['storageErrors'] = $userFileStorage->getErrors();
         }
         if ($this->request->ajax()) {
             return $this->response->json($responseVariables);
         }
     }
     $responseVariables['uploadEntities'] = $uploadEntity->limit(self::UPLOAD_ENTITIES_LIMIT)->orderBy('created_at', 'DESC')->get();
     return $this->view->make('upload.index', $responseVariables);
 }
Пример #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $server = new Server();
     $server->project_id = $request->input('project_id');
     $server->name = $request->input('name');
     $server->ip = $request->input('ip');
     $server->server_user = $request->input('user');
     $server->path = $request->input('path');
     $server->keep_releases = 5;
     $server->connection_status = "Unknown";
     $checked = null !== $request->input('receives');
     $server->receives_code = $checked;
     $server->save();
     return redirect()->action('ProjectController@show', ['id' => $server->project_id]);
 }
Пример #3
0
 public function delete($id)
 {
     $server = Server::find($id);
     $server->delete();
     sleep(5);
     return response('', 204);
 }
Пример #4
0
 public function run()
 {
     \App\Server::create(['id' => 1, 'scheme' => 'sftp', 'host' => '192.168.56.56']);
     \App\Server::create(['id' => 2, 'scheme' => 'ftp', 'host' => '192.168.56.1']);
     \App\Server::create(['id' => 3, 'scheme' => 'sftp', 'host' => 'unknown.local']);
     \App\Server::create(['id' => 4, 'scheme' => 'sftp', 'host' => 'noconfig.local']);
 }
Пример #5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $env = Environment::findOrFail($id);
     $projects = Project::lists('name', 'id')->prepend('');
     $servers = Server::lists('name', 'id')->prepend('');
     return view('environment.edit', ['target_env' => $env, 'projects' => $projects, 'servers' => $servers]);
 }
Пример #6
0
 public function index()
 {
     \App\Gini\Gapper\Client::init();
     if (\App\Gini\Gapper\Client::getUserName()) {
         return view('dashboard', ['products_count' => Product::count(), 'servers_count' => Server::count(), 'clients_count' => Client::where('parent_id', 0)->count(), 'projects_count' => Project::count()]);
     }
     return view('login');
 }
Пример #7
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $servers = Server::paginate(1);
     $news = Category::where('type', NEWS_CAT)->where('status', 1)->first();
     $galaries = Galary::where('status', 1)->get();
     $articles = Category::getPostAvaiable($news);
     return view('frontend.index.main')->with('news_articles', $articles)->with('news', $news)->with("galaries", $galaries)->with('servers', $servers);
 }
Пример #8
0
 public function srv($name)
 {
     $server = Server::where('name', $name);
     if (!$server->count()) {
         \Log::info("Server with name {$name} does not exist");
         return null;
     }
     return $server->first()->id;
 }
Пример #9
0
 public function __construct()
 {
     $servers = Server::all();
     foreach ($servers as $server) {
         //connect for QLAccount
         \Config::set('database.connections.' . $server->user_db, array('driver' => $server->driver, 'host' => $server->host, 'database' => $server->user_db, 'username' => $server->username, 'password' => $server->password));
         //connect for QLGame
         \Config::set('database.connections.' . $server->game_db, array('driver' => $server->driver, 'host' => $server->host, 'database' => $server->game_db, 'username' => $server->username, 'password' => $server->password));
     }
 }
Пример #10
0
 public function getEdit($id)
 {
     $user = $this->user->find($id);
     $admins = Admin::all();
     /*pega o id do servidor atual*/
     $servers = Server::all();
     /*pega o ip do servidor */
     $resellers = Reseller::all();
     /*pega o ip do servidor */
     $packages = Package::all();
     return view('admin.users.edit', compact('admins', 'servers', 'resellers', 'user', 'packages'));
 }
Пример #11
0
 public function run()
 {
     DB::table('servers')->delete();
     Server::create(['name' => 'Web VM', 'ip_address' => '192.168.33.50', 'user' => 'vagrant', 'path' => '/var/www', 'project_id' => 1]);
     Server::create(['name' => 'Cron VM', 'ip_address' => '192.168.33.60', 'user' => 'vagrant', 'path' => '/var/www', 'project_id' => 1]);
     // Server::create([
     //     'name'       => 'DB VM',
     //     'ip_address' => '192.168.33.70',
     //     'user'       => 'vagrant',
     //     'path'       => '/var/www',
     //     'project_id' => 1
     // ]);
 }
Пример #12
0
 public function postEdit(Request $request, $idServer)
 {
     $data = $request->except('_token');
     $rulesEdit = ['hostname' => "required|unique:servers,hostname,{$idServer}", 'username' => 'required', 'nsmaster' => "required|unique:servers,nsmaster,{$idServer}", 'nsslave' => "required|unique:servers,nsslave,{$idServer}", 'password' => 'required'];
     $validator = $this->validator->make($data, $rulesEdit);
     if ($validator->fails()) {
         return redirect("admin/servers/edit/{$idServer}")->withErrors($validator)->withInput();
     }
     Server::where('id', $idServer)->update($data);
     $status = "Successfully updated server!";
     $this->request->session()->flash('status', $status);
     return redirect('admin/servers');
 }
Пример #13
0
 public function deployProjectpost(Request $request)
 {
     //dd($request);
     //middleware check if user matches with project + server
     $user = Auth::user();
     $project = Project::find($request->input('project_id'));
     $server_ids = $request->input('server_ids');
     for ($i = 0; $i < sizeof($server_ids); $i++) {
         $deployment = new Deployment();
         $server = Server::find($server_ids[$i]);
         $deployment->project_id = $project->id;
         $deployment->server_id = $server->id;
         $deployment->committer = $user->name;
         $deployment->save();
         $this->dispatch(new DeployJob($project, $server, $deployment));
     }
     return "ok";
 }
Пример #14
0
 public function showServer($id)
 {
     $server = Server::find($id);
     return view('pages.admin.show_server', ['server' => $server]);
 }
Пример #15
0
 public function postChangePassword(Request $request)
 {
     $data = $request->except('_token');
     if (!ServiceAccount::checkCaptcha($data)) {
         return redirect()->route('user.get.changePassword');
     } else {
         if ($data['new_password'] != $data['rePass'] || strlen($data['new_password']) < 6 || strlen($data['new_password']) > 15) {
             return redirect()->route('user.get.changePassword')->with('message', 'Password mới phải trùng nhau và ký tự >6 và <15.');
         }
         if (\Hash::check($data['password'], Auth::user()->password)) {
             $user = User::findOrfail(Auth::user()->id);
             //dd($data);
             $user->password = \Hash::make($data['new_password']);
             $user->save();
             $model = new GAccount();
             //check all user if exsit on all server game
             $servers = Server::all();
             foreach ($servers as $server) {
                 $model->setConnection($server->user_db);
                 try {
                     $account = $model->where('loginName', $user->username)->first();
                 } catch (\Exception $e) {
                     return redirect()->route('user.register')->with('error', 'có lỗi!');
                 }
                 $account->password_hash = ServiceAccount::getPassword($data['new_password']);
                 $account->save();
             }
             return redirect()->route('user.profile')->with('message', 'Đổi mật khẩu thành công!');
         }
     }
 }
Пример #16
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $server = Server::findOrFail($id);
     $server->delete();
     return redirect()->route('admin.server.index')->with('message', 'Xóa xong!');
 }
Пример #17
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Server::truncate();
     $data = [["name" => "Việt Nam", 'image' => 'images/server1.png', 'username' => 'sa', 'password' => '123456', 'driver' => 'sqlsrv', 'host' => '123.31.17.99', 'user_db' => 'QGLAccount', 'game_db' => 'QGLGame']];
     Server::insert($data);
 }
Пример #18
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     $server = Server::findOrFail($id);
     $serverquery = new Swat4Server($server->ip_address, $server->query_port);
     $serverquery->query();
     return \Response::make($serverquery, 200, ['Content-Type' => "text/json"]);
 }
Пример #19
0
 /**
  * Send ticket.
  *
  * @param Request $request
  * @param $server
  * @param $terminal
  */
 public function ticket(TerminalSender $sender, Request $request, $server, $terminal)
 {
     $server = Server::query()->findOrFail($server);
     $terminal = $server->terminals()->findOrFail($terminal);
     $ticket = $this->getRandomUUID(false);
     $imagesList = ['list1', 'list2', 'list2_uv', 'list1_uv', 'list3', 'list4', 'photo', 'dogovor'];
     $images = $files = [];
     foreach ($imagesList as $key => $image) {
         if ($request->hasFile($image)) {
             $img = $request->file($image);
             $images[$key + 1 . '.jpg'] = $img->getRealPath();
         }
     }
     $sender->setCredentials($server->uri, $terminal->guid, $terminal->password);
     $packet = new DataPacket();
     if (!empty($images)) {
         $fileName = time() . '_' . $ticket . '.1.zip';
         $zippy = Zippy::load();
         $zippy->create(storage_path('app/' . $fileName), $images);
         $files['uploadfile'] = storage_path('app/' . $fileName);
         $packet->addPair('FileTypeParts', 1);
         $packet->addPair('FileTotalParts', 1);
         $packet->addPair('FileName', $fileName);
         $packet->addPair('HashFile', md5_file(storage_path('app/' . $fileName)));
     }
     $packet->addPair('global_id', $ticket);
     $packet->addPair('tarif', $request->input('tariff'));
     $packet->addPair('SimCardCode', $request->input('simcard'));
     $packet->addPair('PhoneNumber', '');
     $packet->addPair('PassportValidation', '');
     $result = $sender->send('RequestTicket', $packet, $files);
     /*
             CountDogovorWasPrinted
             PassportValidation
     */
     list($data, $required) = $sender->parseResult($result);
     if (Arr::get($required, 'Result') != 'OK') {
         throw new \RuntimeException();
     }
     $messages = [];
     if ($guid = Arr::get($result, 'global_id')) {
         $messages[] = 'Заявка создана: ' . $guid;
     }
     if ($error = Arr::get($result, 'ErrorMessage')) {
         $messages[] = $error;
     }
     return redirect()->action('\\' . static::class . '@index', [$server->id])->with('message-success', $messages);
 }
Пример #20
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Server::destroy($id);
     return redirect('servers');
 }
 public function show($serverId)
 {
     $server = Server::with('game')->findOrFail($serverId);
     return view('server.show', ['server' => $server, 'page_title' => 'Server detail']);
 }
Пример #22
0
 /**
  * Generate Outage Task Details scoped to Groups
  * @method generateOutageTaskDetailsScopedToGroups
  * @param  Outage                                  $outage [description]
  * @return [type]                                          [description]
  */
 private function generateOutageTaskDetailsScopedToGroups(Outage $outage)
 {
     $groups = $this->scope_to_groups->lists('id');
     switch ($this->task_type) {
         case 'Server Task':
             $servers = \App\Server::active()->whereIn('group_id', $groups);
             if (!!$this->scope_to_operating_systems->count()) {
                 $oses = $this->scope_to_operating_systems->lists('id');
                 $servers = $servers->whereIn('operating_system_id', $oses);
             }
             if ($this->scope_to_production_servers == 1) {
                 $servers = $servers->production();
             } elseif ($this->scope_to_production_servers == 2) {
                 $servers = $servers->nonproduction();
             }
             $servers = $servers->get();
             return $this->generateOutageTaskDetailsScopedToServers($outage, $servers);
         case 'Application Task':
             $applications = \App\Application::active()->whereIn('group_id', $groups)->get();
             return $this->generateOutageTaskDetailsScopedToApplications($outage, $applications);
         case 'Database Task':
             $databases = \App\Database::active()->whereIn('group_id', $groups)->get();
             if ($this->scope_to_production_servers == 1) {
                 $databases = $databases->production();
             } elseif ($this->scope_to_production_servers == 2) {
                 $databases = $databases->nonproduction();
             }
             return $this->generateOutageTaskDetailsScopedToDatabases($outage, $databases);
     }
 }
Пример #23
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $server = new Server($request->only(['host', 'path', 'username', 'password']));
     $server->save();
     return redirect()->action('\\' . static::class . '@index')->with('message-success', 'Server ' . $server->id . ' created');
 }
Пример #24
0
 public function server_edit($id, Request $request)
 {
     $user = \Session::get('user');
     if (!$user->can('项目服务器管理')) {
         abort(401);
     }
     $project = Project::find($id);
     $server = Server::find($request->input('server_id'));
     if ($project->servers()->find($server->id)) {
         $deploy_time = $request->input('deploy_time');
         if (!$deploy_time) {
             $deploy_time = null;
         } else {
             $deploy_time = \Carbon\Carbon::createFromFormat('Y/m/d', $deploy_time);
         }
         $old_deploy_time = $project->servers()->where('server_id', $server->id)->first()->pivot->deploy_time;
         $project->servers()->updateExistingPivot($server->id, ['deploy_time' => $deploy_time]);
         $old = $old_deploy_time->format('Y/m/d');
         $new = $deploy_time->format('Y/m/d');
         Clog::add($project, '修改服务器部署时间', [['old' => $old, 'new' => $new, 'title' => '部署时间']]);
         \Log::notice(strtr('项目服务器部署时间修改: 用户(%name[%id]) 修改了项目(%project_name[%project_id]) 关联的服务器(%server_name[%server_id]) 的部署时间: %old -> %new', ['%name' => $user->name, '%id' => $user->id, '%project_name' => $project->name, '%project_id' => $project->id, '%server_name' => $server->name, '%server_id' => $server->id, '%old' => $old, '%new' => $new]));
         return redirect()->to(route('project.profile', ['id' => $project->id]))->with('message_content', '修改成功')->with('message_type', 'info')->with('tab', 'servers');
     }
 }
Пример #25
0
 /**
  * @api {delete} /Servers/{id} 删除指定的 server
  * @apiGroup Servers
  * @apiVersion 0.0.1
  * @apiParam {Number}  id Server 的 ID
  * @apiSuccessExample {json} Success-Response:
  *     HTTP/1.1 200 OK
  * @apiErrorExample {json} Error-Response:
  *     HTTP/1/1 404 Not Found
  */
 public function destroy($id)
 {
     //
     if (Server::destroy($id)) {
         return response('OK', 200);
     }
     return response('Not Found', 404);
 }
Пример #26
0
 public function getEdit($id)
 {
     $admin = $this->admin->find($id);
     $servers = Server::all();
     return view('admin.administrators.edit', compact('admin', 'servers'));
 }
 public function destroy($serverId)
 {
     $server = Server::findOrFail($serverId);
     $server->delete();
     return Redirect::to(route('admin.server.index'));
 }
Пример #28
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $app = Database::create(["name" => "LogosDB", 'description' => "Logos Production DB", "rpo" => "15 min", "rto" => "15 min", "dr_strategy" => "mirrored. synchronous. drlogos7sql", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id, Person::where('name', 'Davey Griffith')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Logos')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "govern_prod", 'description' => "Govern production database", "rpo" => "15 min", "rto" => "15 min", "dr_strategy" => "mirrored, synchronous, drgovsql", "ha_strategy" => "n/a", "upgrade_readiness" => "Vendor Approved : Unknown\n      Vendor Assist : Unknown\n      Upgrade Advisor :  Yes\n      Issues :\n       Error : SQL Mail Has Been Discontinued. This affects usp_DiskFreeSpaceAlert.\n       Mitigation : Rewrite the USP to use DB Mail instead\n\n       Warning: Several views contain remote references to smalldatetime columns. Under compatibility level 110, remote smalldatetime columns are now returned to local servers as smalldatetime columns instead of as datetime columns. This may make the view unable to accept updates.\n       Mitigation: Keep DBCL at 100 or change the datatype of the remote columns to datetime.\n\n       Warning : The DB Mirroring feature is deprecated and will be removed in a future release.\n       Mitigation : Implement another DR strategy.", "server_id" => Server::where('name', 'govsql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id, Person::where('name', 'Matt Rykaczewski')->first()->id, Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Ed Bennett')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Govern')->first()->id]);
     $app->servers()->attach([Server::where('name', 'govsql')->first()->id]);
     $app = Database::create(["name" => "TrimProduction", 'description' => "Trim Production database", "rpo" => "15 min", "rto" => "1 hour", "dr_strategy" => "mirrored, synchronous, drmsb01sql", "ha_strategy" => "n/a", "upgrade_readiness" => "Vendor Approved : Yes\n      Vendor Assist : N/A\n      Upgrade Advisor :  Yes\n      Issues :\n       Warning: DB Mirroring will be deprecated in a future version\n       Mitigation: Implement another DR strategy", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id, Person::where('name', 'Davey Griffith')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MSBDATA", 'description' => "Govern Reporting Database", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id, Person::where('name', 'Matt Rykaczewski')->first()->id, Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Ed Bennett')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Govern')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "eSuiteDB", 'description' => "eSuite Production DB", "rpo" => "15 min", "rto" => "1 hour", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id, Person::where('name', 'Davey Griffith')->first()->id]);
     $app->applications()->attach([Application::where('name', 'eSuite')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "Monitor", 'description' => "Disk space reporting db.", "server_id" => Server::where('name', 'govsql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'govsql')->first()->id]);
     $app = Database::create(["name" => "LogosMigrate", 'description' => "Logos Upgrade migration db", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "LogosConfig", 'description' => "Logos Upgrade Config DB", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 1, "production_flag" => 0, "ignore_flag" => 1]);
     $app->applications()->attach([Application::where('name', 'Logos')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "TrimTrain", 'description' => "Trim Training Database", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "TrimDevelopment", 'description' => "Trim Testing Database", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "wasteworks", 'description' => "WasteWorks Production DB", "rpo" => "15 min", "rto" => "1 hour", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Elizabeth Grigsby')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'WasteWorks')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "AbraHRMS_Live", 'description' => "Abra Production Database", "rpo" => "15 min", "rto" => "1 hour", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Elizabeth Grigsby')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Abra')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "AbraEmployeeSelfService", 'description' => "Abra Employee Self Service Database", "rpo" => "15 min", "rto" => "1 hour", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Abra')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "AbraHRMS_Sample", 'description' => "Abra Test Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Abra')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Actions", 'description' => "Search Actions Database", "rpo" => "1 hour", "rto" => "1 hour", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Jack Horner')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Actions')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Aimwin", 'description' => "Ambulance Billing Database", "rpo" => "1 hour", "rto" => "1 hour", "upgrade_readiness" => "Vendor Approved : Yes\n      Vendor Assist : N/A\n      Upgrade Advisor : No, incompatible with DBCL 80\n      Issues :\n       Error : The db is at DBCL 80 which is incompatible with SQL Server 2012.\n       Mitigation : The vendor stated that the DBCL can be changed to 100 without a problem.", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Davey Griffith')->first()->id]);
     $app->applications()->attach([Application::where('name', 'AIMS')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Aimwin_Archive", 'description' => "Ambulance Billing Archive Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'AIMS')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Animal", 'description' => "Chameleon (Animal Care) Database", "upgrade_readiness" => "Vendor Approved : Yes\n      Vendor Assist : Vendor will be providing updated views to make the db compatible with DBCL 90.\n      Upgrade Advisor : No, incompatible with DBCL 80\n      Issues :\n       Error : The db is at DBCL 80 which is incompatible with SQL Server 2012. Several views contain unsupported non-ANSI joins which do not work with DBCL > 80.\n       Mitigation : The vendor will be providing updated views that will allow DBCL 90. This will allow us to migrate to 2012.\n\n      The updated views and instructions are in the project folder.", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Chameleon')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "BITDEV", 'description' => "BIT Development Db", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "ElectionsDB_2011copy", 'description' => "ElectionsDB_2011copy", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Elections_2006_May", 'description' => "Elections_2006_May", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Elections_2006_Oct", 'description' => "Elections_2006_Oct", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Elections_2007_Oct", 'description' => "Elections_2007_Oct", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Elections_2008_Oct", 'description' => "Elections_2008_Oct", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Elections_2009_Mar", 'description' => "Elections_2009_Mar", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Logos_DW", 'description' => "Logos Analytics Database", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Logos')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "ProjectBoardProd", 'description' => "Project Board Production Database", "rpo" => "1 day", "rto" => "1 day", "dr_strategy" => "n/a", "ha_strategy" => "n/a", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Project Board CMS')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "Monitor", 'description' => "Disk Space monitoring db", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "ReportServer", 'description' => "Logos Report Server Database", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Logos')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "ReportServerTempDB", 'description' => "ReportServerTempDB", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "LogosRuntimeServices", 'description' => "Logos Runtime Services Database", "server_id" => Server::where('name', 'logos7sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Logos')->first()->id]);
     $app->servers()->attach([Server::where('name', 'logos7sql')->first()->id]);
     $app = Database::create(["name" => "Kodak_TRIM", 'description' => "Microfilm Archive Trim Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Davey Griffith')->first()->id, Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MEdat2011", 'description' => "Max Solutions Ice Rink Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Maximum Solutions')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MEdat2011_Palmer", 'description' => "Max Solutions Palmer Pool Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Maximum Solutions')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MEdat2011_Wasilla", 'description' => "Max Solutions Wasilla Pool Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Maximum Solutions')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ReportServerTempDB", 'description' => "ReportServerTempDB", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ReportServer", 'description' => "Reporting Services Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cAsset", 'description' => "iSupport Asset Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport", 'description' => "iSupport Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Elizabeth Grigsby')->first()->id]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Archive", 'description' => "iSupport Archive Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Bomgar", 'description' => "iSupport Bomgar Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Workflow", 'description' => "iSupport Workflow Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupportReporting", 'description' => "iSupport Reporting Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "SolarWinds", 'description' => "SolarWinds Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Solarwinds')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "TRIM_DEV", 'description' => "Trim Development Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSurvey", 'description' => "iSupport Survey Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MpulseAdmin", 'description' => "MPulse Administration Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'MPulse')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_Test", 'description' => "MPulse Test Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'MPulse')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_Facilities", 'description' => "MPulse Facilities Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'MPulse')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_Fleet", 'description' => "MPulse Fleet Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'MPulse')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_EMS", 'description' => "MPulse EMS Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'MPulse')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "PFD", 'description' => "PFD Garnishment Database", "upgrade_readiness" => "Vendor Approved : N/A\n      Vendor Assist : N/A\n      Upgrade Advisor :  Yes\n      Issues :\n       Warning: UD CLR Objects may function differently in DBCL110.\n       Mitigation: Keep DBCL at 100.", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'PFD Garnishment')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "PFD_Test", 'description' => "PFD Garnishment Testing Database", "upgrade_readiness" => "Vendor Approved : N/A\n      Vendor Assist : N/A\n      Upgrade Advisor :  Yes\n      Issues :\n       Warning: UD CLR Objects may function differently in DBCL110.\n       Mitigation: Keep DBCL at 100.", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'PFD Garnishment')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ProjectBoardTest", 'description' => "Project Board CMS Development Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Project Board CMS')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "OutageTracker", 'description' => "OutageTracker", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MSB_Elections", 'description' => "Elections Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MSB_Elections_Test", 'description' => "Elections Test Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ePO4_MCAFEE-APP", 'description' => "McAfee AV Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Randy Jones')->first()->id, Person::where('name', 'Rod Hoskinson')->first()->id]);
     $app->applications()->attach([Application::where('name', 'McAfee Enterprise AV')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cartegraph_SQL_db01", 'description' => "Cartegraph Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Matt Rykaczewski')->first()->id]);
     $app->applications()->attach([Application::where('name', 'Cartegraph')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MSB_LandManagementDocBrowser", 'description' => "Land Management Document Browser Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Land Management Doc Browser')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "TrimDeploy", 'description' => "Trim Deployment Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "TRIM_Upgrade", 'description' => "Trim Upgrade Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_Facilities_restored", 'description' => "MPulse_Facilities_restored", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_EMS_restored", 'description' => "MPulse_EMS_restored", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "MPulse_Fleet_restored", 'description' => "MPulse_Fleet_restored", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "SYMPRO_Matanuska", 'description' => "Sympro Production Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Sympro')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "TRIM_reporting", 'description' => "Trim Reporting Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'Trim')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ReportServer", 'description' => "Reporting Services Database", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "ReportServerTempDB", 'description' => "ReportServerTempDB", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "OutageTrackerDev", 'description' => "IT Dashboard Development Database", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'IT Dashboard')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "OutageTracker", 'description' => "IT Dashboard Production Database", "server_id" => Server::where('name', 'msbsqlrpt')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->people()->attach([Person::where('name', 'Jeremy Bloomstrom')->first()->id]);
     $app->applications()->attach([Application::where('name', 'IT Dashboard')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msbsqlrpt')->first()->id]);
     $app = Database::create(["name" => "cSupport_Image_Store", 'description' => "iSupport Image Store Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 1, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Archive_Purchase", 'description' => "iSupport Archive Purchase Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Archive_Change", 'description' => "iSupport Archive Change Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "cSupport_Archive_Problem", 'description' => "iSupport Archive Problem Database", "server_id" => Server::where('name', 'msb01sql')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->applications()->attach([Application::where('name', 'iSupport')->first()->id]);
     $app->servers()->attach([Server::where('name', 'msb01sql')->first()->id]);
     $app = Database::create(["name" => "ReportServerTempDB", 'description' => "ReportServerTempDB", "server_id" => Server::where('name', 'sdesql10edit')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'sdesql10edit')->first()->id]);
     $app = Database::create(["name" => "ReportServerTempDB", 'description' => "ReportServerTempDB", "server_id" => Server::where('name', 'sdesql10')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 1]);
     $app->servers()->attach([Server::where('name', 'sdesql10')->first()->id]);
     $app = Database::create(["name" => "ReportServer", 'description' => "Report Server Db", "server_id" => Server::where('name', 'sdesql10')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'sdesql10')->first()->id]);
     $app = Database::create(["name" => "MATSU_CAMA_GIS", 'description' => "GIS Cama DB", "server_id" => Server::where('name', 'sdesql10')->first()->id, "inactive_flag" => 0, "production_flag" => 0, "ignore_flag" => 0]);
     $app->servers()->attach([Server::where('name', 'sdesql10')->first()->id]);
 }
Пример #29
0
 public function delete($id)
 {
     if (!\Session::get('user')->can('服务器信息管理')) {
         abort(401);
     }
     $server = Server::find($id);
     $server_name = $server->name;
     $server_id = $server->id;
     $server->delete();
     $user = \Session::get('user');
     \Log::notice(strtr('服务器删除: 用户(%name[%id]) 删除了服务器 (%server[%server_id])', ['%name' => $user->name, '%id' => $user->id, '%server' => $server_name, '%server_id' => $server_id]));
     return redirect()->to(route('servers'))->with('message_content', '删除成功!')->with('message_type', 'info');
 }
Пример #30
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $server = Server::findOrFail($id);
     \Storage::disk('key_files')->delete($server->host);
     \Storage::disk('key_files')->delete($server->host . '.pub');
     $server->delete();
     return redirect()->route('server.index');
 }