Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // File: seeds/dev/servers.js
- 'use strict';
- const Crypto = require('crypto');
- const _ = require('lodash');
- exports.seed = function( knex, Promise ) {
- let table = 'servers';
- return Promise.join(
- // Removing the deletion, to avoid constraint errors
- // (until we can get the insert working)
- //knex( table ).del(),
- knex.insert([
- { // 1
- created_at: knex.fn.now(),
- server_hostname: 'lpweb01.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 2
- created_at: knex.fn.now(),
- server_hostname: 'ldjen02.server.ad',
- monitoring: 1,
- operating_system_id: 2,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 3
- created_at: knex.fn.now(),
- server_hostname: 'lpnag01.server.ad',
- monitoring: 1,
- operating_system_id: 3,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 4
- created_at: knex.fn.now(),
- server_hostname: 'lpnag02.server.ad',
- monitoring: 1,
- operating_system_id: 3,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 5
- created_at: knex.fn.now(),
- server_hostname: 'lqchef01.server.ad',
- monitoring: 1,
- operating_system_id: 2,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 6
- created_at: knex.fn.now(),
- server_hostname: 'wpdir01.server.ad',
- monitoring: 1,
- operating_system_id: 4,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 7
- created_at: knex.fn.now(),
- server_hostname: 'wpdir02.server.ad',
- monitoring: 1,
- operating_system_id: 4,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 8
- created_at: knex.fn.now(),
- server_hostname: 'lptwst01.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 9
- created_at: knex.fn.now(),
- server_hostname: 'lpngnx01.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 10
- created_at: knex.fn.now(),
- server_hostname: 'wqbatch01.server.ad',
- monitoring: 0,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 11
- created_at: knex.fn.now(),
- server_hostname: 'lscacti01.server.ad',
- monitoring: 0,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 12
- created_at: knex.fn.now(),
- server_hostname: 'lqrhds01.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 13
- created_at: knex.fn.now(),
- server_hostname: 'lqrhds02.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }, { // 14
- created_at: knex.fn.now(),
- server_hostname: 'wsbamboo01.server.ad',
- monitoring: 1,
- operating_system_id: 1,
- root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
- }
- ]).into( table )
- );
- };
Advertisement
Add Comment
Please, Sign In to add comment