X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Ffs-setup;h=f1dd3a8b4ec6f85b581b42bd851be85f4d0e5e41;hb=8f685842fce6c912568c215f645b01b7fc73c647;hp=b7d4a188941ea5102309770c85428657bb62e799;hpb=b295ca59242c863db3f6f79295625392680e144b;p=freeside.git diff --git a/bin/fs-setup b/bin/fs-setup index b7d4a1889..f1dd3a8b4 100755 --- a/bin/fs-setup +++ b/bin/fs-setup @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: fs-setup,v 1.16 1999-02-28 19:44:16 ivan Exp $ +# $Id: fs-setup,v 1.21 2000-01-30 06:03:26 ivan Exp $ # # ivan@sisd.com 97-nov-8,9 # @@ -32,7 +32,22 @@ # fix radius attributes ivan@sisd.com 98-sep-27 # # $Log: fs-setup,v $ -# Revision 1.16 1999-02-28 19:44:16 ivan +# 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 # constructors s/create/new/ pointed out by "Bao C. Ha" # # Revision 1.15 1999/02/27 21:06:21 ivan @@ -82,14 +97,14 @@ BEGIN { $FS::Record::setup_hack = 1; } use strict; use DBI; use FS::dbdef; -use FS::UID qw(adminsuidsetup datasrc checkeuid); +use FS::UID qw(adminsuidsetup datasrc checkeuid getsecrets); use FS::Record; use FS::cust_main_county; die "Not running uid freeside!" unless checkeuid(); my $user = shift or die &usage; -FS::UID::getsecrets $user; +getsecrets($user); #needs to match FS::Record my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc; @@ -119,12 +134,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 @@ -229,7 +239,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' => $_, @@ -463,7 +473,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, ], @@ -581,7 +592,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' => [ [] ],