data update

* foreign keys always enabled on each connection
* implemented data update (create, update, delete)
This commit is contained in:
zegkljan
2022-01-29 00:48:32 +01:00
parent 01fb4c75f8
commit 395b17d1be
5 changed files with 204 additions and 25 deletions
+5 -4
View File
@@ -5,6 +5,7 @@ import geojson "github.com/paulmach/go.geojson"
// core objects
type UserID int
type FeatureID int
type User struct {
ID UserID `json:"id"`
@@ -12,7 +13,7 @@ type User struct {
}
type Feature struct {
ID int `json:"id"`
ID FeatureID `json:"id"`
OwnerID *UserID `json:"owner_id"`
Name string `json:"name"`
Description *string `json:"description"`
@@ -23,9 +24,9 @@ type Feature struct {
// transport objects
type Update struct {
Create []Feature `json:"create"`
Update []Feature `json:"update"`
Delete []UserID `json:"delete"`
Create []Feature `json:"create"`
Update []Feature `json:"update"`
Delete []FeatureID `json:"delete"`
}
type HandshakeChallenge struct {