package models

import (
  "github.com/spacedock-io/registry/db"
)

type Image struct {
  Id        int64
  Uuid      string
  Json      []byte
  Checksum  string
  Size      int64
  Ancestry  []Ancestor
  Tags      []Tag
}

type Ancestor struct {
  Id int64
  ImageId int64
  Name string
}

func (image *Image) Save() error {
  q := db.DB.Save(image)
  return q.Error
}

package models

import (
  "github.com/spacedock-io/registry/db"
)

type Image struct {
  Id        int64
  Uuid      string
  Json      []byte
  Checksum  string
  Size      int64
  Ancestry  []string
  Tags      []Tag
}

func (image *Image) Save() error {
  q := db.DB.Save(image)
  return q.Error
}

--- 
+++ 
@@ -10,8 +10,14 @@
   Json      []byte
   Checksum  string
   Size      int64
-  Ancestry  []string
+  Ancestry  []Ancestor
   Tags      []Tag
+}
+
+type Ancestor struct {
+  Id int64
+  ImageId int64
+  Name string
 }
 
 func (image *Image) Save() error {
Add very basic Ancestry model
