models

package
v0.0.0-...-ac98336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigration

func AutoMigration()

AutoMigration migrates all database schemas.

func CreateDatabase

func CreateDatabase() error

CreateDatabase creates the database in Postgres.

Types

type Heritage

type Heritage struct {
	ID        string     `json:"id" gorm:"primary_key;type:uuid"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`

	Longitude float64      `json:"longitude" gorm:"index"`
	Latitude  float64      `json:"latitude" gorm:"index"`
	Addresses *StringSlice `json:"addresses" gorm:"index;type:jsonb"`
	Commune   string       `json:"commune" gorm:"index"`
	LieuDit   string       `json:"lieu_dit" gorm:"index"`
	Datings   *StringSlice `json:"datings" gorm:"index;type:jsonb"`

	Photos      *StringSlice `json:"photos" gorm:"type:jsonb"`
	Status      string       `json:"status"`
	Study       string       `json:"study"`
	StudiedAt   string       `json:"studied_at"`
	Names       *StringSlice `json:"names" gorm:"type:jsonb"`
	Phase       string       `json:"phase"`
	Description string       `json:"description"`
}

An Heritage is a database record.

func NewHeritage

func NewHeritage(id ...string) *Heritage

NewHeritage returns new Heritage with a default id.

type StringSlice

type StringSlice []string

A StringSlice is a []string with marshalization methods

func NewStringSlice

func NewStringSlice(args ...string) *StringSlice

NewStringSlice returns a StringSlice eventually initialized with the given args.

func (*StringSlice) Scan

func (f *StringSlice) Scan(input interface{}) error

Scan unserializes a StringSlice

func (*StringSlice) Value

func (f *StringSlice) Value() (driver.Value, error)

Value serializes a StringSlice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL