Skip to content

Commit 3eceb3f

Browse files
committed
sqlt-diff: Add option --mysql-version=
Analog to the sqlt script, allow to specify the MySQL producer version. Stops converting varchar(>255) to text columns for version>5.000003
1 parent 18be6d1 commit 3eceb3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

script/sqlt-diff

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Options:
4646
--ignore-constraint-names Ignore constraint name differences
4747
--mysql_parser_version=<#####> Specify a target MySQL parser version
4848
for dealing with /*! comments
49+
--mysql-producer-version=<#####> Specify a target MySQL producer version
4950
--output-db=<Producer> This Producer will be used instead of one
5051
corresponding to parser1 to format output
5152
for new tables
@@ -117,7 +118,7 @@ use vars qw( $VERSION );
117118
$VERSION = '1.66';
118119

119120
my (@input, $list, $help, $debug, $trace, $caseopt, $ignore_index_names, $ignore_constraint_names, $output_db,
120-
$mysql_parser_version, $ignore_view_sql, $ignore_proc_sql, $no_batch_alters, $quote);
121+
$mysql_parser_version, $mysql_producer_version, $ignore_view_sql, $ignore_proc_sql, $no_batch_alters, $quote);
121122

122123
GetOptions(
123124
'l|list' => \$list,
@@ -128,6 +129,7 @@ GetOptions(
128129
'ignore-index-names' => \$ignore_index_names,
129130
'ignore-constraint-names' => \$ignore_constraint_names,
130131
'mysql_parser_version:s' => \$mysql_parser_version,
132+
'mysql-producer-version:s'=> \$mysql_producer_version,
131133
'output-db:s' => \$output_db,
132134
'ignore-view-sql' => \$ignore_view_sql,
133135
'ignore-proc-sql' => \$ignore_proc_sql,
@@ -195,6 +197,7 @@ my $result = SQL::Translator::Diff::schema_diff(
195197
sqlt_args => {
196198
quote_table_names => $quote || '',
197199
quote_field_names => $quote || '',
200+
mysql_version => $mysql_producer_version,
198201
},
199202
}
200203
);

0 commit comments

Comments
 (0)