Skip to content

Commit

Permalink
Fix #610 and impacted unit tests, evolving the expectations.
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe- committed Jan 30, 2025
1 parent 7053b94 commit b4b3c42
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 56 deletions.
2 changes: 2 additions & 0 deletions src/Components/AlterOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class AlterOperation extends Component
2,
'var',
],
'UNIQUE' => 2,
'UNIQUE KEY' => 2,

'CHARACTER SET' => 3,
'TO' => [
Expand Down
26 changes: 12 additions & 14 deletions tests/data/parser/parseAlter14.out
Original file line number Diff line number Diff line change
Expand Up @@ -325,24 +325,22 @@
"options": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD"
"1": "ADD",
"2": "UNIQUE KEY"
}
},
"field": null,
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "functional_index",
"expr": "`functional_index`",
"alias": null,
"function": null,
"subquery": null
},
"partitions": null,
"unknown": [
{
"@type": "@10"
},
{
"@type": "@11"
},
{
"@type": "@12"
},
{
"@type": "@13"
},
{
"@type": "@14"
},
Expand Down
26 changes: 12 additions & 14 deletions tests/data/parser/parseAlterTableAddUniqueKey1.out
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,22 @@
"options": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD"
"1": "ADD",
"2": "UNIQUE KEY"
}
},
"field": null,
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "name_of_the_unique_constraint",
"expr": "name_of_the_unique_constraint",
"alias": null,
"function": null,
"subquery": null
},
"partitions": null,
"unknown": [
{
"@type": "@10"
},
{
"@type": "@11"
},
{
"@type": "@12"
},
{
"@type": "@13"
},
{
"@type": "@14"
},
Expand Down
26 changes: 12 additions & 14 deletions tests/data/parser/parseAlterTableAddUniqueKey2.out
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,22 @@
"options": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD"
"1": "ADD",
"2": "UNIQUE"
}
},
"field": null,
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "name_of_the_unique_constraint",
"expr": "name_of_the_unique_constraint",
"alias": null,
"function": null,
"subquery": null
},
"partitions": null,
"unknown": [
{
"@type": "@10"
},
{
"@type": "@11"
},
{
"@type": "@12"
},
{
"@type": "@13"
},
{
"@type": "@14"
},
Expand Down
26 changes: 12 additions & 14 deletions tests/data/parser/parsephpMyAdminExport1.out
Original file line number Diff line number Diff line change
Expand Up @@ -5401,24 +5401,22 @@
"options": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD"
"1": "ADD",
"2": "UNIQUE KEY"
}
},
"field": null,
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "idServer",
"expr": "`idServer`",
"alias": null,
"function": null,
"subquery": null
},
"partitions": null,
"unknown": [
{
"@type": "@394"
},
{
"@type": "@395"
},
{
"@type": "@396"
},
{
"@type": "@397"
},
{
"@type": "@398"
},
Expand Down

0 comments on commit b4b3c42

Please sign in to comment.