VoipNow export, #11170
[freeside.git] / FS / FS / Schema.pm
index 327c96c..ecfb0e4 100644 (file)
@@ -347,7 +347,7 @@ sub tables_hashref_torrus {
       ],
       'primary_key' => 'id',
       'unique' => [],
-      'index'  => [ ['srv_date'], ['serviceid'], ],
+      'index'  => [ ['srv_date'], ['srv_date', 'srv_time'], ['serviceid'], ],
     },
 
     #Tables for (currently monthly only) report contents.
@@ -1428,11 +1428,12 @@ sub tables_hashref {
         'manual_flag',        'char', 'NULL',  1, '', '', 
         'no_auto',            'char', 'NULL',  1, '', '', 
         'quantity',            'int', 'NULL', '', '', '',
+        'agent_pkgid',         'int', 'NULL', '', '', '',
       ],
       'primary_key' => 'pkgnum',
       'unique' => [],
       'index' => [ ['custnum'], ['pkgpart'], [ 'pkgbatch' ], [ 'locationnum' ],
-                   [ 'usernum' ],
+                   [ 'usernum' ], [ 'agent_pkgid' ],
                    [ 'start_date' ], ['setup'], ['last_bill'], ['bill'],
                    ['susp'], ['adjourn'], ['expire'], ['cancel'],
                    ['change_date'], ['order_date'],
@@ -3265,8 +3266,43 @@ sub tables_hashref {
       'index'  => [], #recnum
     },
 
+    'areacode'  => {
+      'columns' => [
+        'code',        'char',        '',       3, '', '', 
+        'country',     'char',    'NULL',       2, '', '',
+        'state',       'char',    'NULL',       2, '', '', 
+        'description','varchar',  'NULL',     255, '', '',
+      ], 
+      'primary_key' => 'code',
+      'unique' => [],
+      'index'  => [],
+    },
+
     %{ tables_hashref_torrus() },
 
+    # tables of ours for doing torrus virtual port combining
+    'torrus_srvderive' => {
+      'columns' => [
+        'derivenum',     'serial',     '', '', '', '',
+        'serviceid',    'varchar',     '', 64, '', '', #srvexport / reportfields
+        'last_srv_date',   'date', 'NULL', '', '', '',
+      ],
+      'primary_key' => 'derivenum',
+      'unique' => [ ['serviceid'] ],
+      'index'  => [],
+    },
+
+    'torrus_srvderive_component' => {
+      'columns' => [
+        'componentnum', 'serial', '', '', '', '',
+        'derivenum',       'int', '', '', '', '',
+        'serviceid',   'varchar', '', 64, '', '', #srvexport / reportfields
+      ],
+      'primary_key' => 'componentnum',
+      'unique'      => [ [ 'derivenum', 'serviceid' ], ],
+      'index'       => [ [ 'derivenum', ], ],
+    },
+
 
     # name type nullability length default local