5 use DBIx::DBSchema 0.26;
6 use FS::UID qw(adminsuidsetup datasrc driver_name);
9 my $user = shift or die &usage;
11 $FS::Schema::setup_hack = 1;
12 $FS::CurrentUser::upgrade_hack = 1;
13 my($dbh)=adminsuidsetup $user;
15 #needs to match FS::Record
16 my($dbdef_file) = "%%%FREESIDE_CONF%%%/dbdef.". datasrc;
18 my $dbdef = new_native DBIx::DBSchema $dbh;
20 #print $dbdef->pretty_print;
23 $dbdef->save($dbdef_file);
26 die "Usage:\n dbdef-create user\n";
31 freeside-dbdef-create - Recreate database schema cache
35 freeside-dbdef-create user
39 Reverse engineers the database schema and recreates the dbdef cache file.