Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse SRID in column definition #595

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Components/CreateDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class CreateDefinition extends Component
'ENFORCED' => 14,
'NOT' => 15,
'COMPRESSED' => 16,
'SRID' => [
17,
'var',
],
// Common entries.
//
// NOTE: Some of the common options are not in the same order which
Expand Down
1 change: 1 addition & 0 deletions tests/Parser/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public static function createProvider(): array
['parser/parseCreateTableAsSelect'],
['parser/parseCreateTableLike'],
['parser/parseCreateTableSpatial'],
['parser/parseCreateTableSRID'],
['parser/parseCreateTableTimestampWithPrecision'],
['parser/parseCreateTableEnforcedCheck'],
['parser/parseCreateTableNotEnforcedCheck'],
Expand Down
7 changes: 7 additions & 0 deletions tests/data/parser/parseCreateTableSRID.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS `public_areas` (
`id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
`kind` enum('COUNTRY','REGION','DEPARTMENT','MUNICIPALITY') NOT NULL,
`area` geometry NOT NULL SRID 4326,
`properties` json NOT NULL,
`title` varchar(100) NOT NULL
);
Loading
Loading