From 9d5a0977dc63e16a998d91ca54f1168fe481522a Mon Sep 17 00:00:00 2001 From: Michael Conrad Date: Mon, 8 May 2023 02:40:55 -0400 Subject: [PATCH] Round-trip AUTOINCREMENT in SQLite parser Currently, the SQLite parser sees the AUTOINCREMENT keyword and sets the column flag is_auto_increment, but the SQLite Producer will not write the AUTOINCREMENT keyword unless extra.auto_increment_type is 'monotonic'. This breaks round-trip by the AUTOINCREMENT keyword getting lost. --- lib/SQL/Translator/Parser/SQLite.pm | 1 + t/23json.t | 3 +++ t/24yaml.t | 2 ++ 3 files changed, 6 insertions(+) diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index aa80ffe1..5e69e83b 100644 --- a/lib/SQL/Translator/Parser/SQLite.pm +++ b/lib/SQL/Translator/Parser/SQLite.pm @@ -681,6 +681,7 @@ sub parse { size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, + ($fdata->{'is_auto_inc'}? ( extra => { auto_increment_type => 'monotonic' } ) : ()), is_nullable => $fdata->{'is_nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; diff --git a/t/23json.t b/t/23json.t index b185c584..c1773a37 100644 --- a/t/23json.t +++ b/t/23json.t @@ -109,6 +109,9 @@ my $json = from_json(<