[freeside-commits] freeside/FS/bin freeside-dbdef-create, NONE, 1.2.2.2
Ivan,,,
ivan at wavetail.420.am
Sat Jun 21 13:07:08 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv28911/FS/bin
Added Files:
Tag: FREESIDE_1_7_BRANCH
freeside-dbdef-create
Log Message:
backport freeside-dbdef-create from HEAD
--- NEW FILE: freeside-dbdef-create ---
#!/usr/bin/perl -Tw
use strict;
use DBI;
use DBIx::DBSchema 0.26;
use FS::UID qw(adminsuidsetup datasrc driver_name);
use FS::Schema;
my $user = shift or die &usage;
$FS::Schema::setup_hack = 1;
$FS::CurrentUser::upgrade_hack = 1;
my($dbh)=adminsuidsetup $user;
#needs to match FS::Record
my($dbdef_file) = "%%%FREESIDE_CONF%%%/dbdef.". datasrc;
my $dbdef = new_native DBIx::DBSchema $dbh;
#print $dbdef->pretty_print;
#important
$dbdef->save($dbdef_file);
sub usage {
die "Usage:\n dbdef-create user\n";
}
=head1 NAME
freeside-dbdef-create - Recreate database schema cache
=head1 SYNOPSIS
freeside-dbdef-create user
=head1 DESCRIPTION
Reverse engineers the database schema and recreates the dbdef cache file.
=head1 SEE ALSO
L<DBIx::DBSchema>
=cut
1;
More information about the freeside-commits
mailing list