webservice infrastructure, RT#33849
[freeside.git] / FS / FS / Schema.pm
index f5cde48..422ecd9 100644 (file)
@@ -194,10 +194,9 @@ sub dbdef_dist {
     grep {    ! /^(clientapi|access_user)_session/
            && ! /^h_/
            && ! /^log(_context)?$/
-           && ! /^legacy_cust_history$/
+           && ! /^(legacy_cust_history|cacti_page|access_user_log)$/
            && ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} )
            && ! $tables_hashref_torrus->{$_}
-           && ! /^cacti_page$/
          }
       $dbdef->tables
   ) {
@@ -1356,6 +1355,8 @@ sub tables_hashref {
         '_date',        @date_type,             '', '', 
         'disabled',         'char', 'NULL',  1, '', '', 
         'usernum',           'int', 'NULL', '', '', '',
+        'close_date',   @date_type,             '', '', 
+        'confidence',        'int', 'NULL', '', '', '',
         #'total',      @money_type,       '', '', 
         #'quotation_term', 'varchar', 'NULL', $char_d, '', '',
       ],
@@ -1612,6 +1613,7 @@ sub tables_hashref {
         'taxname',  'varchar',  'NULL',    $char_d, '', '', 
         'setuptax',  'char', 'NULL', 1, '', '', # Y = setup tax exempt
         'recurtax',  'char', 'NULL', 1, '', '', # Y = recur tax exempt
+        'source',   'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'taxnum',
       'unique' => [],
@@ -4728,8 +4730,9 @@ sub tables_hashref {
         'ont_typenum',    'int', 'NULL',      '', '', '',
         'ont_serial', 'varchar', 'NULL', $char_d, '', '',
         'ont_port',   'varchar', 'NULL',      16, '', '',
+        'circuit_id', 'varchar', 'NULL', $char_d, '', '',
         'vlan',           'int', 'NULL',      '', '', '',
-        'signal',         'int', 'NULL',      '', '', '',
+        'signal',     'decimal', 'NULL',  '10,2', '', '',
         'speed_up',       'int', 'NULL',      '', '', '',
         'speed_down',     'int', 'NULL',      '', '', '',
         'ont_install','varchar', 'NULL', $char_d, '', '',
@@ -4743,14 +4746,35 @@ sub tables_hashref {
       'columns' => [
         'oltnum',   'serial', '',       '', '', '',
         'oltname', 'varchar', '',  $char_d, '', '',
+        'sitenum',     'int', 'NULL',   '', '', '',
         'serial',  'varchar', '',  $char_d, '', '',
         'disabled',   'char', 'NULL',    1, '', '',
       ],
       'primary_key' => 'oltnum',
       'unique' => [ ],
       'index'  => [ ],
+      'foreign_keys' => [
+                          { columns => [ 'sitenum' ],
+                            table   => 'olt_site',
+                          },
+                        ],
+    },
+
+    'olt_site' => {
+      'columns' => [
+        'sitenum',  'serial', '',      '', '', '',
+        'market',  'varchar', '', $char_d, '', '',
+        'site',    'varchar', '', $char_d, '', '',
+      ],
+      'primary_key' => 'sitenum',
+      'unique' => [ [ 'market', 'site' ] ],
+      'index' => [ ],
     },
 
+
+
+
+
     'vend_main' => {
       'columns' => [
         'vendnum',   'serial',     '',      '', '', '',
@@ -5079,6 +5103,29 @@ sub tables_hashref {
                         ],
     },
 
+    'webservice_log' => {
+      'columns' => [
+        'webservicelognum',    'serial',      '',      '', '', '', #big? hubrus
+        'svcnum',                 'int',  'NULL',      '', '', '', #just in case
+        'custnum',                'int',      '',      '', '', '',
+        'method',             'varchar',      '', $char_d, '', '',
+        'quantity',               'int',      '',      '', '', '', #i.e. pages
+        '_date',             @date_type,                   '', '',
+        'status',             'varchar',  'NULL', $char_d, '', '', 
+        'rated_price',        'decimal',  'NULL',  '10,2', '', '',
+      ],
+      'primary_key'  => 'webservicelognum',
+      'unique'       => [],
+      'index'        => [ ['custnum'], ['status'] ],
+      'foreign_keys' => [
+                          { columns => [ 'custnum' ],
+                            table   => 'cust_main',
+                          },
+                          #no FK on svcnum... we don't want to purge these on
+                          # service deletion
+                        ],
+    },
+
     # name type nullability length default local
 
     #'new_table' => {