Closed dnmfarrell closed 8 years ago
@sillymoose welcome! By adding 'SQLite' to the interchange6-create-database script I was able to generate sqlite sql file. We do test againt sqlite so this should work but please let us know if you run into trouble.
https://github.com/interchange/interchange6-schema/blob/master/bin/interchange6-create-database
#! /usr/bin/env perl
use strict;
use warnings;
use Interchange6::Schema;
use Getopt::Long;
my ($mysql_version, $postgres_version, $clean);
GetOptions (
"clean" => \$clean,
"mysql_version=s" => \$mysql_version,
"postgres_version=s" => \$postgres_version,
) or die("Error in command line arguments\n");
my $dsn = shift;
my $schema = Interchange6::Schema->connect($dsn);
$schema->create_ddl_dir(['MySQL', 'PostgreSQL','SQLite'],
$Interchange6::Schema::VERSION,
'./sql',
undef,
# needed for MySQL producer, otherwise booleans are broken
# https://github.com/interchange/interchange6-schema/issues/1
{
producer_args => {
mysql_version => $mysql_version || 5,
postgres_version => $postgres_version || 9,
},
add_drop_table => $clean,
},
);
Fantastic, thank you :)
Tested on local, works for me.
@sillymoose we aren't really happy with this solution please follow #143 for further improvements proposed for this script. But as you can see the sql files generated are usable atm.
Closing issue since further activity will be tracked against issue #143
Hi,
Can you add sqlite3 support? I edited the output sql script to fit the sqlite3 syntax. Not sure how helpful this is: