Revision: 46080
Author:   tparscal
Date:     2009-01-23 18:19:16 +0000 (Fri, 23 Jan 2009)

Log Message:
-----------
Moved dummy data into import script. Now CLI/Initialize.php only rebuilds 
tables, and CLI/Import.php when used with the --dummy parameter loads the 
tables with a default dataset. Additionally this now logs changes for each 
component in the dataset, making the change history function properly.

Modified Paths:
--------------
    trunk/extensions/DataCenter/DataCenter.sql

Added Paths:
-----------
    trunk/extensions/DataCenter/CLI/Import.php

Added: trunk/extensions/DataCenter/CLI/Import.php
===================================================================
--- trunk/extensions/DataCenter/CLI/Import.php                          (rev 0)
+++ trunk/extensions/DataCenter/CLI/Import.php  2009-01-23 18:19:16 UTC (rev 
46080)
@@ -0,0 +1,286 @@
+<?php
+
+require_once dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) .
+       '/maintenance/commandLine.inc';
+
+if ( isset( $options['help'] ) ) {
+       echo "Imports data into DataCenter tables.\n";
+       echo "Usage:\n";
+       echo "\tphp extensions/DataCenter/CLI/Import.php --dummy \n";
+       echo "\tImports dummy data into tables, useful for testing.\n";
+} else {
+       if ( isset( $options['dummy'] ) ) {
+               echo "Importing dummy data into DataCenter tables...\n";
+               require_once dirname( dirname( __FILE__ ) ) . 
'/DataCenter.db.php';
+               function randAlphaNum() {
+                       return strtoupper( substr( md5( rand() ), 0, 10 ) );
+               }
+               function randNum() {
+                       return rand( 1111111111, 9999999999 );
+               }
+               $data = array(
+                       array(
+                               'function' => array( 'DataCenterDBLocation', 
'newFromValues' ),
+                               'fields' => array(
+                                       'tense', 'name', 'region', 'latitude', 
'longitude'
+                               ),
+                               'values' => array(
+                                       array( 'present', 'PMTPA', 'Tampa, FL', 
27.98141, -82.451141 ),
+                                       array( 'present', 'SFO', 'San 
Francisco, CA', 37.775196, -122.419204 ),
+                               )
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBSpace', 
'newFromValues' ),
+                               'fields' => array(
+                                       'tense', 'name', 'location', 'width', 
'height', 'depth', 'power'
+                               ),
+                               'values' => array(
+                                       array( 'present', 'Server Room', 1, 3, 
3, 7, 1000 ),
+                                       array( 'present', 'Data Closet', 2, 3, 
3, 5, 200 ),
+                               )
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBAsset', 
'newFromType' ),
+                               'parameter' => 'rack',
+                               'fields' => array(
+                                       'tense', 'model', 'location', 'asset', 
'serial'
+                           ),
+                               'values' => array(
+                               array( 'present', 2, 1, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 1, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 1, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 1, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 1, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 2, randAlphaNum(), 
randNum() ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBAsset', 
'newFromType' ),
+                               'parameter' => 'object',
+                               'fields' => array(
+                                       'tense', 'model', 'location', 'asset', 
'serial'
+                           ),
+                               'values' => array(
+                               array( 'present', 1, 2, randAlphaNum(), 
randNum() ),
+                               array( 'present', 1, 2, randAlphaNum(), 
randNum() ),
+                               array( 'present', 1, 2, randAlphaNum(), 
randNum() ),
+                               array( 'present', 1, 2, randAlphaNum(), 
randNum() ),
+                               array( 'present', 2, 2, randAlphaNum(), 
randNum() ),
+                               array( 'present', 3, 2, randAlphaNum(), 
randNum() ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBModel', 
'newFromType' ),
+                               'parameter' => 'rack',
+                               'fields' => array(
+                                       'manufacturer', 'name', 'kind', 'units'
+                           ),
+                               'values' => array(
+                               array( 'Rittal', 'TS-42', 'Rack', 42 ),
+                               array( 'Rittal', 'TS-44', 'Rack', 44 ),
+                               array( 'Rittal', 'TS-47', 'Rack', 47 ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBModel', 
'newFromType' ),
+                               'parameter' => 'object',
+                               'fields' => array(
+                                       'manufacturer', 'name', 'kind', 
'form_factor', 'units', 'depth', 'power'
+                           ),
+                               'values' => array(
+                               array( 'Sun', 'Cobalt RaQ XTR', 'Web Server', 
'rackunit', 2, 3, 400 ),
+                               array( 'Cisco', 'Catalyst 2950', 'Switch', 
'rackunit', 1, 1, 100 ),
+                               array( 'APC', 'Smart-UPS 3000VA', 'UPS', 
'rackunit', 5, 2, 20 ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBModel', 
'newFromType' ),
+                               'parameter' => 'port',
+                               'fields' => array(
+                                       'name', 'kind', 'category', 'format'
+                           ),
+                               'values' => array(
+                               array( '1000Base-ZX', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-CX4', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-ER', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-Kx', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-LR', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-LRM', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-LX4', 'Ethernet', 'network', 
'digital' ),
+                               array( '10GBase-ZR', 'Ethernet', 'network', 
'digital' ),
+                               array( 'LC/1000Base-LX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'LC/1000Base-SX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'LC/100Base-FX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'LC/100Base-SX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'LC/10GBase-SR', 'Ethernet', 'network', 
'digital' ),
+                               array( 'RJ-45/1000Base-T', 'Ethernet', 
'network', 'digital' ),
+                               array( 'RJ-45/100Base-TX', 'Ethernet', 
'network', 'digital' ),
+                               array( 'RJ-45/10Base-T', 'Ethernet', 'network', 
'digital' ),
+                               array( 'SC/1000Base-LX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'SC/1000Base-SX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'SC/100Base-FX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'SC/100Base-SX', 'Ethernet', 'network', 
'digital' ),
+                               array( 'BNC/10Base2', 'Token Ring', 'network', 
'digital' ),
+                               array( 'RS-232', 'Serial', 'serial', 'digital' 
),
+                               array( 'RS-442', 'Serial', 'serial', 'digital' 
),
+                               array( 'IEC 120v', 'Power', 'power', 'none' ),
+                               array( 'IEC 240v', 'Power', 'power', 'none' ),
+                               array( 'Type A 120v', 'Power', 'power', 'none' 
),
+                               array( 'Type B 120v', 'Power', 'power', 'none' 
),
+                               array( 'Type C 240v', 'Power', 'power', 'none' 
),
+                               array( 'Type F 240v', 'Power', 'power', 'none' 
),
+                               array( 'PS2', 'User Input', 'serial', 'digital' 
),
+                               array( 'USB 1.0', 'USB', 'serial', 'digital' ),
+                               array( 'USB 2.0', 'USB', 'serial', 'digital' ),
+                               array( 'IEEE 1394a', 'FireWire', 'serial', 
'digital' ),
+                               array( 'IEEE 1394b', 'FireWire', 'serial', 
'digital' ),
+                               array( 'IEEE 1394c', 'FireWire', 'serial', 
'digital' ),
+                               array( 'VGA', 'Video', 'video', 'analog' ),
+                               array( 'DVI', 'Video', 'video', 'digital' ),
+                               array( 'MiniDVI', 'Video', 'video', 'digital' ),
+                               array( 'MicroDVI', 'Video', 'video', 'digital' 
),
+                               array( 'Optical Audio', 'Audio', 'audio', 
'digital' ),
+                               array( 'Analog Audio', 'Audio', 'audio', 
'analog' ),
+                               array( 'Hybrid Audio', 'Audio', 'audio', 
'mixed' ),
+                               array( 'Other', 'Port', 'other', 'none' ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBMetaField', 
'newFromValues' ),
+                               'fields' => array(
+                                       'name', 'format'
+                           ),
+                               'values' => array(
+                               array( 'WikiMedia Owned', 'boolean' ),
+                               array( 'Notes', 'text' ),
+                               array( 'Weight (LBS)', 'number' ),
+                               array( 'Assigned User', 'string' ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBMetaValue', 
'newFromValues' ),
+                               'fields' => array(
+                                       'component_category', 'component_type', 
'component_id', 'field', 'value'
+                           ),
+                               'values' => array(
+                               array( 'facility', 'location', 2, 1, true ),
+                               array( 'facility', 'location', 2, 2, 'The best 
place to be!' ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBPlan', 
'newFromValues' ),
+                               'fields' => array(
+                                       'tense', 'space', 'name', 'note'
+                           ),
+                               'values' => array(
+                               array( 'present', 1, 'PMTA 1.0', 'Current 
configuration' ),
+                               array( 'present', 2, 'SFO 1.0', 'Incomplete but 
current' ),
+                               array( 'future', 1, 'PMTA 1.1', 'Upcoming 
configuration' ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBAssetLink', 
'newFromValues' ),
+                               'fields' => array(
+                                       'name', 'plan', 'tense', 'parent_link', 
'asset_type', 'asset_id', 'x', 'y', 'z', 'orientation'
+                           ),
+                               'values' => array(
+                               array( 'Rack 1A', 1, 'present', null, 'rack', 
1, 2, 1, null, 1 ),
+                               array( 'Rack 1B', 1, 'present', null, 'rack', 
2, 2, 2, null, 1 ),
+                               array( 'Rack 1C', 1, 'present', null, 'rack', 
3, 2, 3, null, 1 ),
+                               array( 'Rack 1D', 1, 'present', null, 'rack', 
4, 2, 4, null, 1 ),
+                               array( 'Rack 1E', 1, 'present', null, 'rack', 
5, 2, 5, null, 1 ),
+                               array( 'Rack 1A', 2, 'present', null, 'rack', 
6, 3, 4, null, 1 ),
+                               array( 'Web Server A', 2, 'present', 6, 
'object', 1, null, null, 1, 0 ),
+                               array( 'Web Server B', 2, 'present', 6, 
'object', 2, null, null, 3, 0 ),
+                               array( 'Web Server C', 2, 'present', 6, 
'object', 3, null, null, 5, 0 ),
+                               array( 'Web Server D', 2, 'present', 6, 
'object', 4, null, null, 7, 0 ),
+                               array( 'Switch', 2, 'present', 6, 'object', 5, 
null, null, 9, 0 ),
+                               array( 'UPS', 2, 'present', 6, 'object', 6, 
null, null, 10, 0 ),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 'DataCenterDBModelLink', 
'newFromValues' ),
+                               'fields' => array(
+                                       'name', 'quantity', 'parent_type', 
'parent_id', 'child_type', 'child_id'
+                           ),
+                               'values' => array(
+                               array( 'Ethernet', 2, 'object', 1, 'port', 14 ),
+                               array( 'Ethernet', 24, 'object', 2, 'port', 14 
),
+                               array( 'Power In', 1, 'object', 3, 'port', 27 ),
+                               array( 'Power Out', 8, 'object', 3, 'port', 24 
),
+                               ),
+                       ),
+                       array(
+                               'function' => array( 
'DataCenterDBMetaFieldLink', 'newFromValues' ),
+                               'fields' => array(
+                                       'field', 'component_category', 
'component_type'
+                           ),
+                               'values' => array(
+                               array( 1, 'facility', 'location' ),
+                               array( 1, 'facility', 'space' ),
+                               array( 1, 'asset', 'rack' ),
+                               array( 1, 'asset', 'object' ),
+                               array( 2, 'facility', 'location' ),
+                               array( 2, 'facility', 'space' ),
+                               array( 2, 'asset', 'rack' ),
+                               array( 2, 'asset', 'object' ),
+                               array( 2, 'model', 'rack' ),
+                               array( 2, 'model', 'object' ),
+                               array( 2, 'model', 'port' ),
+                               array( 3, 'asset', 'object' ),
+                               array( 4, 'asset', 'object' ),
+                               ),
+                       ),
+               );
+               foreach ( $data as $type ) {
+                       // Checks if fields, values and function exist
+                       if (
+                               isset( $type['fields'] ) &&
+                               isset( $type['values'] ) &&
+                               isset( $type['function'] )
+                       ) {
+                               $values = array();
+                               foreach ( $type['values'] as $row ) {
+                                       // Correlates data
+                                       $values = array();
+                                       if ( count( $row ) == count( 
$type['fields'] ) ) {
+                                               foreach ( $type['fields'] as 
$index => $field ) {
+                                                       $values[$field] = 
$row[$index];
+                                               }
+                                       } else {
+                                               throw new MWException(
+                                                       'Mismatch of fields and 
values lengths!'
+                                               );
+                                       }
+                                       // Checks if call and parameter exist
+                                       if ( isset( $type['parameter'] ) ) {
+                                               // Builds row object
+                                               $row = call_user_func(
+                                                       $type['function'], 
$type['parameter'], $values
+                                               );
+                                       // Alernatively checks if only call 
exists
+                                       } else {
+                                               // Builds row object
+                                               $row = call_user_func( 
$type['function'], $values );
+                                       }
+                                       // Inserts row
+                                       $row->insert();
+                                       if ( $row instanceof 
DataCenterDBComponent ) {
+                                               $row->insertChange(
+                                                       array(
+                                                               'type' => 
'import',
+                                                               'note' => 
'Initial import'
+                                                       )
+                                               );
+                                       }
+                               }
+                       } else {
+                               throw new MWException(
+                                       'Incomplete data!'
+                               );
+                       }
+               }
+       } else {
+               echo "Run with --help for usage information.\n";
+       }
+}
\ No newline at end of file

Modified: trunk/extensions/DataCenter/DataCenter.sql
===================================================================
--- trunk/extensions/DataCenter/DataCenter.sql  2009-01-23 18:19:01 UTC (rev 
46079)
+++ trunk/extensions/DataCenter/DataCenter.sql  2009-01-23 18:19:16 UTC (rev 
46080)
@@ -376,204 +376,3 @@
     -- 
     PRIMARY KEY (mta_con_id)
 ) /*$wgDBTableOptions*/;
--- 
---  Initial Facilities
--- 
-INSERT INTO /*$wgDBprefix*/dc_facility_locations
-    (
-        fcl_loc_tense, fcl_loc_name, fcl_loc_region, fcl_loc_latitude,
-        fcl_loc_longitude
-    )
-    VALUES
-        ( 'present', 'PMTPA', 'Tampa, FL', 27.98141, -82.451141 ),
-        ( 'present', 'SFO', 'San Francisco, CA', 37.775196, -122.419204 );
--- 
-INSERT INTO /*$wgDBprefix*/dc_facility_spaces
-    (
-        fcl_spc_tense, fcl_spc_name, fcl_spc_location, fcl_spc_width,
-        fcl_spc_height, fcl_spc_depth,  fcl_spc_power
-    )
-    VALUES
-        ( 'present', 'Server Room', 1, 3, 3, 7, 1000 ),
-        ( 'present', 'Data Closet', 2, 3, 3, 5, 200 );
--- 
---  Initial Assets
--- 
-INSERT INTO /*$wgDBprefix*/dc_rack_assets
-    (
-        ast_rak_model, ast_rak_tense, ast_rak_location, ast_rak_asset,
-        ast_rak_serial
-    )
-    VALUES
-        ( 2, 'present', 1, '1230112301', '1Q2W3E4R5T6Y7U' ),
-        ( 2, 'present', 1, '2340223402', '1A2S3D4F5G6H7J' ),
-        ( 2, 'present', 1, '3450334503', '1Z2X3C4V5B6N7M' ),
-        ( 2, 'present', 1, '4560445604', 'Q1W2E3R4T5Y6U7' ),
-        ( 2, 'present', 1, '5670556705', 'A1S2D3F4G5H6J7' ),
-        ( 2, 'present', 2, '6780667806', 'Z1X2C3V4B5N6M7' );
--- 
-INSERT INTO /*$wgDBprefix*/dc_object_assets
-    (
-        ast_obj_model, ast_obj_tense, ast_obj_location, ast_obj_asset,
-        ast_obj_serial
-    )
-    VALUES
-        ( 1, 'present', 2, '1230112301', '1Q2W3E4R5T6Y7U' ),
-        ( 1, 'present', 2, '2340223402', '1A2S3D4F5G6H7J' ),
-        ( 1, 'present', 2, '3450334503', '1Z2X3C4V5B6N7M' ),
-        ( 1, 'present', 2, '4560445604', 'Q1W2E3R4T5Y6U7' ),
-        ( 2, 'present', 2, '5670556705', 'A1S2D3F4G5H6J7' ),
-        ( 3, 'present', 2, '6780667806', 'Z1X2C3V4B5N6M7' );
--- 
--- Initial Models
--- 
-INSERT INTO /*$wgDBprefix*/dc_rack_models
-    (
-        mdl_rak_manufacturer, mdl_rak_name, mdl_rak_kind, mdl_rak_units
-    )
-    VALUES
-        ( 'Rittal', 'TS-42', 'Rack', 42 ),
-        ( 'Rittal', 'TS-44', 'Rack', 44 ),
-        ( 'Rittal', 'TS-47', 'Rack', 47 );
--- 
-INSERT INTO /*$wgDBprefix*/dc_object_models
-    (
-        mdl_obj_manufacturer, mdl_obj_name, mdl_obj_kind, mdl_obj_form_factor,
-        mdl_obj_units, mdl_obj_depth, mdl_obj_power
-    )
-    VALUES
-        ( 'Sun', 'Cobalt RaQ XTR', 'Web Server', 'rackunit', 2, 3, 400 ),
-        ( 'Cisco', 'Catalyst 2950', 'Switch', 'rackunit', 1, 1, 100 ),
-        ( 'APC', 'Smart-UPS 3000VA', 'UPS', 'rackunit', 5, 2, 20 );
--- 
-INSERT INTO /*$wgDBprefix*/dc_port_models
-    (
-        mdl_prt_name, mdl_prt_kind, mdl_prt_category, mdl_prt_format
-    )
-    VALUES
-        ( '1000Base-ZX', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-CX4', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-ER', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-Kx', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-LR', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-LRM', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-LX4', 'Ethernet', 'network', 'digital' ),
-        ( '10GBase-ZR', 'Ethernet', 'network', 'digital' ),
-        ( 'LC/1000Base-LX', 'Ethernet', 'network', 'digital' ),
-        ( 'LC/1000Base-SX', 'Ethernet', 'network', 'digital' ),
-        ( 'LC/100Base-FX', 'Ethernet', 'network', 'digital' ),
-        ( 'LC/100Base-SX', 'Ethernet', 'network', 'digital' ),
-        ( 'LC/10GBase-SR', 'Ethernet', 'network', 'digital' ),
-        ( 'RJ-45/1000Base-T', 'Ethernet', 'network', 'digital' ),
-        ( 'RJ-45/100Base-TX', 'Ethernet', 'network', 'digital' ),
-        ( 'RJ-45/10Base-T', 'Ethernet', 'network', 'digital' ),
-        ( 'SC/1000Base-LX', 'Ethernet', 'network', 'digital' ),
-        ( 'SC/1000Base-SX', 'Ethernet', 'network', 'digital' ),
-        ( 'SC/100Base-FX', 'Ethernet', 'network', 'digital' ),
-        ( 'SC/100Base-SX', 'Ethernet', 'network', 'digital' ),
-        ( 'BNC/10Base2', 'Token Ring', 'network', 'digital' ),
-        ( 'RS-232', 'Serial', 'serial', 'digital' ),
-        ( 'RS-442', 'Serial', 'serial', 'digital' ),
-        ( 'IEC 120v', 'Power', 'power', 'none' ),
-        ( 'IEC 240v', 'Power', 'power', 'none' ),
-        ( 'Type A 120v', 'Power', 'power', 'none' ),
-        ( 'Type B 120v', 'Power', 'power', 'none' ),
-        ( 'Type C 240v', 'Power', 'power', 'none' ),
-        ( 'Type F 240v', 'Power', 'power', 'none' ),
-        ( 'PS2', 'User Input', 'serial', 'digital' ),
-        ( 'USB 1.0', 'USB', 'serial', 'digital' ),
-        ( 'USB 2.0', 'USB', 'serial', 'digital' ),
-        ( 'IEEE 1394a', 'FireWire', 'serial', 'digital' ),
-        ( 'IEEE 1394b', 'FireWire', 'serial', 'digital' ),
-        ( 'IEEE 1394c', 'FireWire', 'serial', 'digital' ),
-        ( 'VGA', 'Video', 'video', 'analog' ),
-        ( 'DVI', 'Video', 'video', 'digital' ),
-        ( 'MiniDVI', 'Video', 'video', 'digital' ),
-        ( 'MicroDVI', 'Video', 'video', 'digital' ),
-        ( 'Optical Audio', 'Audio', 'audio', 'digital' ),
-        ( 'Analog Audio', 'Audio', 'audio', 'analog' ),
-        ( 'Hybrid Audio', 'Audio', 'audio', 'mixed' ),
-        ( 'Other', 'Port', 'other', 'none' );
--- 
--- Initial Meta
--- 
-INSERT INTO /*$wgDBprefix*/dc_meta_fields
-    (
-        mta_fld_name, mta_fld_format
-    )
-    VALUES
-        ( 'WikiMedia Owned', 'boolean' ),
-        ( 'Notes', 'text' ),
-        ( 'Weight (LBS)', 'number' ),
-        ( 'Assigned User', 'string' );
--- 
-INSERT INTO /*$wgDBprefix*/dc_meta_values
-    (
-        mta_val_component_category, mta_val_component_type,
-        mta_val_component_id, mta_val_field, mta_val_value
-    )
-    VALUES
-        ( 'facility', 'location', 2, 1, true ),
-        ( 'facility', 'location', 2, 2, 'The best place to be!' );
---
-INSERT INTO /*$wgDBprefix*/dc_meta_plans
-    (
-        mta_pln_tense, mta_pln_space, mta_pln_name, mta_pln_note
-    )
-    VALUES
-    ( 'present', 1, 'PMTA 1.0', 'Current configuration' ),
-    ( 'present', 2, 'SFO 1.0', 'Incomplete but current' ),
-    ( 'future', 1, 'PMTA 1.1', 'Upcoming configuration' );
--- 
--- Initial Links
--- 
-INSERT INTO /*$wgDBprefix*/dc_asset_links
-    (
-        lnk_ast_name, lnk_ast_plan, lnk_ast_tense, lnk_ast_parent_link,
-        lnk_ast_asset_type, lnk_ast_asset_id, lnk_ast_x, lnk_ast_y, lnk_ast_z,
-        lnk_ast_orientation
-    )
-    VALUES
-        ( 'Rack 1A', 1, 'present', null, 'rack', 1, 2, 1, null, 1 ),
-        ( 'Rack 1B', 1, 'present', null, 'rack', 2, 2, 2, null, 1 ),
-        ( 'Rack 1C', 1, 'present', null, 'rack', 3, 2, 3, null, 1 ),
-        ( 'Rack 1D', 1, 'present', null, 'rack', 4, 2, 4, null, 1 ),
-        ( 'Rack 1E', 1, 'present', null, 'rack', 5, 2, 5, null, 1 ),
-        ( 'Rack 1A', 2, 'present', null, 'rack', 6, 3, 4, null, 1 ),
-        ( 'Web Server A', 2, 'present', 6, 'object', 1, null, null, 1, 0 ),
-        ( 'Web Server B', 2, 'present', 6, 'object', 2, null, null, 3, 0 ),
-        ( 'Web Server C', 2, 'present', 6, 'object', 3, null, null, 5, 0 ),
-        ( 'Web Server D', 2, 'present', 6, 'object', 4, null, null, 7, 0 ),
-        ( 'Switch', 2, 'present', 6, 'object', 5, null, null, 9, 0 ),
-        ( 'UPS', 2, 'present', 6, 'object', 6, null, null, 10, 0 );
--- 
-INSERT INTO /*$wgDBprefix*/dc_model_links
-    (
-        lnk_mdl_name, lnk_mdl_quantity, lnk_mdl_parent_type,
-        lnk_mdl_parent_id, lnk_mdl_child_type, lnk_mdl_child_id
-    )
-    VALUES
-        ( 'Ethernet', 2, 'object', 1, 'port', 14 ),
-        ( 'Ethernet', 24, 'object', 2, 'port', 14 ),
-        ( 'Power In', 1, 'object', 3, 'port', 27 ),
-        ( 'Power Out', 8, 'object', 3, 'port', 24 );
--- 
-INSERT INTO /*$wgDBprefix*/dc_field_links
-    (
-        lnk_fld_field, lnk_fld_component_category, lnk_fld_component_type
-    )
-    VALUES
-        ( 1, 'facility', 'location' ),
-        ( 1, 'facility', 'space' ),
-        ( 1, 'asset', 'rack' ),
-        ( 1, 'asset', 'object' ),
-        ( 2, 'facility', 'location' ),
-        ( 2, 'facility', 'space' ),
-        ( 2, 'asset', 'rack' ),
-        ( 2, 'asset', 'object' ),
-        ( 2, 'model', 'rack' ),
-        ( 2, 'model', 'object' ),
-        ( 2, 'model', 'port' ),
-        ( 3, 'asset', 'object' ),
-        ( 4, 'asset', 'object' );
--- 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to