#
# Create Index
#
-create : CREATE TEMPORARY(?) UNIQUE(?) INDEX WORD ON table_name parens_field_list conflict_clause(?) SEMICOLON
+create : CREATE TEMPORARY(?) UNIQUE(?) INDEX NAME ON table_name parens_field_list conflict_clause(?) SEMICOLON
{
my $db_name = $item[7]->{'db_name'} || '';
my $table_name = $item[7]->{'name'};
elsif ( $c->{'type'} eq 'default' ) {
$column->{'default'} = $c->{'value'};
}
+ elsif ( $c->{'type'} eq 'autoincrement' ) {
+ $column->{'is_auto_inc'} = 1;
+ }
}
$column;
reference_fields => $item[2]{'reference_fields'},
}
}
+ |
+ AUTOINCREMENT
+ {
+ $return = {
+ type => 'autoincrement',
+ }
+ }
constraint_def : PRIMARY_KEY parens_field_list conflict_clause(?)
{
REFERENCES : /references/i
+AUTOINCREMENT : /autoincrement/i
+
UNIQUE : /unique/i { 1 }
SEMICOLON : ';'
-NAME : /'?(\w+)'?/ { $return = $1 }
+NAME : /["']?(\w+)["']?/ { $return = $1 }
VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/
{ $item[1] }