linking DIDs and users to PBXes, RT#7051
[freeside.git] / FS / FS / Schema.pm
index 1f595a8..ebfce79 100644 (file)
@@ -256,7 +256,7 @@ sub dbdef_dist {
             } );
     
             if ( $column->type =~ /^(\w*)SERIAL$/i ) {
-              $column->type('int');
+              $column->type(uc($1).'INT');
               $column->null('NULL');
             }
             #$column->default('')
@@ -378,11 +378,11 @@ sub tables_hashref {
         'custnum',   'int', '', '', '', '',
         '_date',     @date_type, '', '',
         'otaker',    'varchar', '', 32, '', '',
-        'filename',  'varchar', '', 32, '', '',
-        'mime_type', 'varchar', '', 32, '', '',
-        'title',     'varchar', 'NULL', 32, '', '',
+        'filename',  'varchar', '', 255, '', '',
+        'mime_type', 'varchar', '', $char_d, '', '',
+        'title',     'varchar', 'NULL', $char_d, '', '',
         'body',      'blob', 'NULL', '', '', '',
-        'disabled',  'varchar', 'NULL', '10', '',
+        'disabled',  @date_type, '', '',
       ],
       'primary_key' => 'attachnum',
       'unique'      => [],
@@ -1475,14 +1475,15 @@ sub tables_hashref {
         'downbytes_threshold',   'bigint', 'NULL',   '', '', '',
         'totalbytes','bigint', 'NULL',   '', '', '',
         'totalbytes_threshold',   'bigint', 'NULL',   '', '', '',
-        'domsvc',    'int', '',   '', '', '', 
+        'domsvc',    'int',     '', '', '', '', 
+        'pbxsvc',    'int', 'NULL', '', '', '',
         'last_login',  @date_type, '', '', 
         'last_logout', @date_type, '', '', 
       ],
       'primary_key' => 'svcnum',
       #'unique' => [ [ 'username', 'domsvc' ] ],
       'unique' => [],
-      'index' => [ ['username'], ['domsvc'] ],
+      'index' => [ ['username'], ['domsvc'], ['pbxsvc'] ],
     },
 
     'acct_rt_transaction' => {
@@ -2401,10 +2402,11 @@ sub tables_hashref {
         'pin',          'varchar', 'NULL', $char_d, '', '',
         'sip_password', 'varchar', 'NULL', $char_d, '', '',
         'phone_name',   'varchar', 'NULL', $char_d, '', '',
+        'pbxsvc',           'int', 'NULL',      '', '', '',
       ],
       'primary_key' => 'svcnum',
       'unique' => [],
-      'index'  => [ [ 'countrycode', 'phonenum' ] ],
+      'index'  => [ [ 'countrycode', 'phonenum' ], ['pbxsvc'] ],
     },
 
     'phone_device' => {
@@ -2499,6 +2501,20 @@ sub tables_hashref {
       'unique'      => [ [ 'pkgnum', 'refnum' ] ],
       'index'       => [ [ 'pkgnum' ], [ 'refnum' ] ],
     },
+
+    'svc_pbx' => {
+      'columns' => [
+        'svcnum',         'int',     '',      '', '', '', 
+        'id',             'int', 'NULL',      '', '', '', 
+        'title',      'varchar', 'NULL', $char_d, '', '', 
+        'max_extensions', 'int', 'NULL',      '', '', '',
+      ],
+      'primary_key' => 'svcnum',
+      'unique' => [],
+      'index'  => [ [ 'id' ] ],
+    },
+
+
     # name type nullability length default local
 
     #'new_table' => {