s/icradiusmachine/machine/
[freeside.git] / bin / fs-setup
index d21b41d..3dde038 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
-# $Id: fs-setup,v 1.17 1999-04-14 07:58:39 ivan Exp $
+# $Id: fs-setup,v 1.24 2000-03-02 07:44:07 ivan Exp $
 #
 # ivan@sisd.com 97-nov-8,9
 #
 # fix radius attributes ivan@sisd.com 98-sep-27
 #
 # $Log: fs-setup,v $
-# Revision 1.17  1999-04-14 07:58:39  ivan
+# Revision 1.24  2000-03-02 07:44:07  ivan
+# typo forgot closing '
+#
+# Revision 1.23  2000/02/03 05:16:52  ivan
+# beginning of DNS and Apache support
+#
+# Revision 1.22  2000/01/31 05:22:23  ivan
+# prepaid "internet cards"
+#
+# Revision 1.21  2000/01/30 06:03:26  ivan
+# postgres 6.5 finally supports decimal(10,2)
+#
+# Revision 1.20  2000/01/28 22:53:33  ivan
+# track full phone number
+#
+# Revision 1.19  1999/07/29 08:50:35  ivan
+# wrong type for cust_pay_batch.exp
+#
+# Revision 1.18  1999/04/15 22:46:30  ivan
+# TT isn't a state!
+#
+# Revision 1.17  1999/04/14 07:58:39  ivan
 # export getsecrets from FS::UID instead of calling it explicitly
 #
 # Revision 1.16  1999/02/28 19:44:16  ivan
@@ -122,12 +143,7 @@ my($char_d) = 80; #default maxlength for text fields
 #my(@date_type)  = ( 'timestamp', '', ''     );
 my(@date_type)  = ( 'int', 'NULL', ''     );
 my(@perl_type) = ( 'varchar', 'NULL', 255  ); 
-my(@money_type);
-if (datasrc =~ m/Pg/) { #Pg can't do decimal(10,2)
-  @money_type = ( 'money',   '', '' );
-} else {
-  @money_type = ( 'decimal',   '', '10,2' );
-}
+my @money_type = ( 'decimal',   '', '10,2' );
 
 ###
 # create a dbdef object from the old data structure
@@ -174,7 +190,7 @@ my($part_svc)=$dbdef->table('part_svc');
 #because of svc_acct_pop
 #foreach (grep /^svc_/, $dbdef->tables) { 
 #foreach (qw(svc_acct svc_acct_sm svc_charge svc_domain svc_wo)) {
-foreach (qw(svc_acct svc_acct_sm svc_domain)) {
+foreach (qw(svc_acct svc_acct_sm svc_domain svc_www)) {
   my($table)=$dbdef->table($_);
   my($col);
   foreach $col ( $table->columns ) {
@@ -232,7 +248,7 @@ foreach  ($dbdef->tables) {
 foreach ( qw(
 AL AK AS AZ AR CA CO CT DC DE FM FL GA GU HI ID IL IN IA KS KY LA
 ME MH MD MA MI MN MS MO MT NC ND NE NH NJ NM NV NY MP OH OK OR PA PW PR RI 
-SC SD TN TX TT UT VT VI VA WA WV WI WY AE AA AP
+SC SD TN TX UT VT VI VA WA WV WI WY AE AA AP
 ) ) {
   my($cust_main_county)=new FS::cust_main_county({
     'state' => $_,
@@ -466,7 +482,8 @@ sub tables_hash_hack {
         'country',  'char', '',     2,
         'trancode', 'int', '', '',
         'cardnum',  'varchar', '',     16,
-        'exp',      @date_type,
+        #'exp',      @date_type,
+        'exp',      'varchar', '',     11,
         'payname',  'varchar', 'NULL', $char_d,
         'amount',   @money_type,
       ],
@@ -584,7 +601,7 @@ sub tables_hash_hack {
         'state',     'varchar',   '',   $char_d,
         'ac',        'char',   '',   3,
         'exch',      'char',   '',   3,
-        #rest o' number?
+        'loc',       'char',   'NULL',   4, #NULL for legacy purposes
       ],
       'primary_key' => 'popnum',
       'unique' => [ [] ],
@@ -642,6 +659,31 @@ sub tables_hash_hack {
       'index' => [ [] ],
     },
 
+    'domain_record' => {
+      'columns' => [
+        'recnum',    'int',     '',  '',
+        'svcnum',    'int',     '',  '',
+        'reczone',   'varchar', '',  $char_d,
+        'recaf',     'char',    '',  2,
+        'rectype',   'char',    '',  5,
+        'recdata',   'varchar', '',  $char_d,
+      ],
+      'primary_key' => 'recnum',
+      'unique'      => [ [] ],
+      'index'       => [ ['svcnum'] ],
+    },
+
+    'svc_www' => {
+      'columns' => [
+        'svcnum',   'int',    '',  '',
+        'recnum',   'int',    '',  '',
+        'usersvc',  'int',    '',  '',
+      ],
+      'primary_key' => 'svcnum',
+      'unique'      => [ [] ],
+      'index'       => [ [] ],
+    },
+
     #'svc_wo' => {
     #  'columns' => [
     #    'svcnum',    'int',    '',   '',
@@ -655,6 +697,17 @@ sub tables_hash_hack {
     #  'index' => [ [] ],
     #},
 
+    'prepay_credit' => {
+      'columns' => [
+        'prepaynum',   'int',     '',   '',
+        'identifier',  'varchar', '', $char_d,
+        'amount',      @money_type,
+      ],
+      'primary_key' => 'prepaynum',
+      'unique'      => [ ['identifier'] ],
+      'index'       => [ [] ],
+    },
+
   );
 
   %tables;