Skip to content

Commit ae9f475

Browse files
authored
Merge pull request #1241 from appwrite/cli-sdk-spatial
2 parents b4a2fd9 + 95f91ca commit ae9f475

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

templates/cli/lib/commands/push.js.twig

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ const {
4343
databasesUpdateEnumAttribute,
4444
databasesUpdateRelationshipAttribute,
4545
databasesCreateRelationshipAttribute,
46+
databasesCreatePointAttribute,
47+
databasesUpdatePointAttribute,
48+
databasesCreateLineAttribute,
49+
databasesUpdateLineAttribute,
50+
databasesCreatePolygonAttribute,
51+
databasesUpdatePolygonAttribute,
4652
databasesDeleteAttribute,
4753
databasesDeleteIndex,
4854
databasesListAttributes,
@@ -562,6 +568,33 @@ const createAttribute = (databaseId, collectionId, attribute) => {
562568
onDelete: attribute.onDelete,
563569
parseOutput: false
564570
})
571+
case 'point':
572+
return databasesCreatePointAttribute({
573+
databaseId,
574+
collectionId,
575+
key:attribute.key,
576+
required:attribute.required,
577+
xdefault:attribute.default,
578+
parseOutput:false
579+
})
580+
case 'linestring':
581+
return databasesCreateLineAttribute({
582+
databaseId,
583+
collectionId,
584+
key:attribute.key,
585+
required:attribute.required,
586+
xdefault:attribute.default,
587+
parseOutput:false
588+
})
589+
case 'polygon':
590+
return databasesCreatePolygonAttribute({
591+
databaseId,
592+
collectionId,
593+
key:attribute.key,
594+
required:attribute.required,
595+
xdefault:attribute.default,
596+
parseOutput:false
597+
})
565598
default:
566599
throw new Error(`Unsupported attribute type: ${attribute.type}`);
567600
}
@@ -681,6 +714,33 @@ const updateAttribute = (databaseId, collectionId, attribute) => {
681714
onDelete: attribute.onDelete,
682715
parseOutput: false
683716
})
717+
case 'point':
718+
return databasesUpdatePointAttribute({
719+
databaseId,
720+
collectionId,
721+
key:attribute.key,
722+
required:attribute.required,
723+
xdefault:attribute.default,
724+
parseOutput:false
725+
})
726+
case 'linestring':
727+
return databasesUpdateLineAttribute({
728+
databaseId,
729+
collectionId,
730+
key:attribute.key,
731+
required:attribute.required,
732+
xdefault:attribute.default,
733+
parseOutput:false
734+
})
735+
case 'polygon':
736+
return databasesUpdatePolygonAttribute({
737+
databaseId,
738+
collectionId,
739+
key:attribute.key,
740+
required:attribute.required,
741+
xdefault:attribute.default,
742+
parseOutput:false
743+
})
684744
default:
685745
throw new Error(`Unsupported attribute type: ${attribute.type}`);
686746
}

0 commit comments

Comments
 (0)