1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-11-24 17:07:00 +02:00
pocketbase/models/collection.go
2022-07-07 00:19:05 +03:00

28 lines
806 B
Go

package models
import "github.com/pocketbase/pocketbase/models/schema"
var _ Model = (*Collection)(nil)
type Collection struct {
BaseModel
Name string `db:"name" json:"name"`
System bool `db:"system" json:"system"`
Schema schema.Schema `db:"schema" json:"schema"`
ListRule *string `db:"listRule" json:"listRule"`
ViewRule *string `db:"viewRule" json:"viewRule"`
CreateRule *string `db:"createRule" json:"createRule"`
UpdateRule *string `db:"updateRule" json:"updateRule"`
DeleteRule *string `db:"deleteRule" json:"deleteRule"`
}
func (m *Collection) TableName() string {
return "_collections"
}
// BaseFilesPath returns the storage dir path used by the collection.
func (m *Collection) BaseFilesPath() string {
return m.Id
}