jLinux

Untitled

Dec 25th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // File: seeds/dev/applications_servers.js
  2.  
  3.     'use strict';
  4.  
  5.     exports.seed = function( knex, Promise ) {
  6.         let table = 'applications_servers';
  7.  
  8.         return Promise.join(
  9.             // Removing the deletion, to avoid constraint errors
  10.             // (until we can get the insert working)
  11.             //knex( table ).del(),
  12.  
  13.             knex.insert( [
  14.                 // lpweb01: Apache, PHP, Chef Client
  15.                 { created_at: knex.fn.now(), server_id: 1, application_id: 1   },
  16.                 { created_at: knex.fn.now(), server_id: 1, application_id: 4   },
  17.                 { created_at: knex.fn.now(), server_id: 1, application_id: 9   },
  18.                 // lpngnx01: Nginx, PHP, Chef Client
  19.                 { created_at: knex.fn.now(), server_id: 9, application_id: 3   },
  20.                 { created_at: knex.fn.now(), server_id: 9, application_id: 4   },
  21.                 { created_at: knex.fn.now(), server_id: 9, application_id: 9   },
  22.                 // ldjen02: Jenkins, Chef Client
  23.                 { created_at: knex.fn.now(), server_id: 2, application_id: 5   },
  24.                 { created_at: knex.fn.now(), server_id: 2, application_id: 9   },
  25.                 // lpnag01 & lpnag02: Nagios, Chef Client
  26.                 { created_at: knex.fn.now(), server_id: 3, application_id: 2   },
  27.                 { created_at: knex.fn.now(), server_id: 3, application_id: 9   },
  28.                 { created_at: knex.fn.now(), server_id: 4, application_id: 2   },
  29.                 { created_at: knex.fn.now(), server_id: 4, application_id: 9   },
  30.                 // lqchef01: Chef Server
  31.                 { created_at: knex.fn.now(), server_id: 5, application_id: 6   },
  32.                 // wpdir01 & wpdir02: Active Directory
  33.                 { created_at: knex.fn.now(), server_id: 6, application_id: 8   },
  34.                 { created_at: knex.fn.now(), server_id: 7, application_id: 8   },
  35.                 // lptwst01: Tumbleweed, Chef Client
  36.                 { created_at: knex.fn.now(), server_id: 8, application_id: 7   },
  37.                 { created_at: knex.fn.now(), server_id: 8, application_id: 9   },
  38.                 // lscacti01: Cacti, Chef Client,
  39.                 { created_at: knex.fn.now(), server_id: 11, application_id: 9  },
  40.                 { created_at: knex.fn.now(), server_id: 11, application_id: 12 },
  41.                 // wqbatch01: Batch Server
  42.                 { created_at: knex.fn.now(), server_id: 10, application_id: 10 },
  43.                 // lqrhds01 & lqrhds02: LDAP, Chef Client
  44.                 { created_at: knex.fn.now(), server_id: 12, application_id: 11 },
  45.                 { created_at: knex.fn.now(), server_id: 13, application_id: 8  },
  46.                 { created_at: knex.fn.now(), server_id: 12, application_id: 11 },
  47.                 { created_at: knex.fn.now(), server_id: 13, application_id: 8  },
  48.                 // wsbamboo01: Bamboo
  49.                 { created_at: knex.fn.now(), server_id: 14, application_id: 13 }
  50.             ]).into( table )
  51.       );
  52.     };
Add Comment
Please, Sign In to add comment