# ivan@sisd.com 98-sep-4
#
# fix radius attributes ivan@sisd.com 98-sep-27
+#
+# $Log: fs-setup,v $
+# Revision 1.5 1998-11-15 09:43:03 ivan
+# update for new config file syntax, new adminsuidsetup
+#
+# Revision 1.4 1998/10/22 15:51:23 ivan
+# also varchar with no length specified - postgresql fix broke mysql.
+#
+# Revision 1.3 1998/10/22 15:46:28 ivan
+# now smallint is illegal, so remove that too.
+#
#to delay loading dbdef until we're ready
BEGIN { $FS::Record::setup_hack = 1; }
use FS::Record;
use FS::cust_main_county;
+my $user = shift or die &usage;
+FS::UID::getsecrets $user;
+
#needs to match FS::Record
-my($dbdef_file) = "/var/spool/freeside/dbdef.". datasrc;
+my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc;
###
#my(@date_type) = ( 'timestamp', '', '' );
my(@date_type) = ( 'int', 'NULL', '' );
-my(@perl_type) = ( 'long varchar', 'NULL', '' );
+my(@perl_type) = ( 'varchar', 'NULL', 255 );
my(@money_type);
if (datasrc =~ m/Pg/) { #Pg can't do decimal(10,2)
@money_type = ( 'money', '', '' );
#important
$dbdef->save($dbdef_file);
-FS::Record::reload_dbdef;
+FS::Record::reload_dbdef($dbdef_file);
###
# create 'em
###
-my($dbh)=adminsuidsetup;
+my($dbh)=adminsuidsetup $user;
+warn $dbh;
#create tables
$|=1;
$dbh->disconnect or die $dbh->errstr;
+sub usage {
+ die "Usage:\n fs-setup user\n";
+}
+
###
# Now it becomes an object. much better.
###
'agentnum', 'int', '', '',
'agent', 'varchar', '', $char_d,
'typenum', 'int', '', '',
- 'freq', 'smallint', 'NULL', '',
+ 'freq', 'int', 'NULL', '',
'prog', @perl_type,
],
'primary_key' => 'agentnum',
'columns' => [
'taxnum', 'int', '', '',
'state', 'char', '', 2, #two letters max in US... elsewhere?
- 'county', 'varchar', '', $char_d,
+ 'county', 'varchar', 'NULL', $char_d,
'tax', 'real', '', '', #tax %
],
'primary_key' => 'taxnum',
'state', 'char', '', 2,
'zip', 'varchar', '', 10,
'country', 'char', '', 2,
- 'trancode', 'TINYINT', '', '',
+ 'trancode', 'int', '', '',
'cardnum', 'varchar', '', 16,
'exp', @date_type,
'payname', 'varchar', 'NULL', $char_d,
'pkg', 'varchar', '', $char_d,
'comment', 'varchar', '', $char_d,
'setup', @perl_type,
- 'freq', 'smallint', '', '', #billing frequency (months)
+ 'freq', 'int', '', '', #billing frequency (months)
'recur', @perl_type,
],
'primary_key' => 'pkgpart',
'username', 'varchar', '', $username_len, #unique (& remove dup code)
'_password', 'varchar', '', 25, #13 for encryped pw's plus ' *SUSPENDED*
'popnum', 'int', 'NULL', '',
- 'uid', 'bigint', 'NULL', '',
- 'gid', 'bigint', 'NULL', '',
+ 'uid', 'int', 'NULL', '',
+ 'gid', 'int', 'NULL', '',
'finger', 'varchar', 'NULL', $char_d,
'dir', 'varchar', 'NULL', $char_d,
'shell', 'varchar', 'NULL', $char_d,
'columns' => [
'svcnum', 'int', '', '',
'domsvc', 'int', '', '',
- 'domuid', 'bigint', '', '',
+ 'domuid', 'int', '', '',
'domuser', 'varchar', '', $char_d,
],
'primary_key' => 'svcnum',