#!/usr/bin/perl -Tw
-#
-# $Id: dbdef-create,v 1.3 2001-04-15 12:56:31 ivan Exp $
-#
-# create dbdef file for existing mySQL database (needs SHOW|DESCRIBE command
-# not in Pg) based on fs-setup
-#
-# ivan@sisd.com 98-jun-2
-#
-# $Log: dbdef-create,v $
-# Revision 1.3 2001-04-15 12:56:31 ivan
-# s/dbdef/DBIx::DBSchema/
-#
-# Revision 1.2 1998/11/19 11:17:44 ivan
-# adminsuidsetup requires argument
-#
use strict;
use DBI;
-use DBIx::DBSchema;
+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 = new_native DBIx::DBSchema $dbh;
+#print $dbdef->pretty_print;
+
#important
$dbdef->save($dbdef_file);