migrations

package
v0.0.0-...-834c3ea Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLastMigration

func GetLastMigration(db *database.DB) string

GetLastMigration get the previous migrations in the database.

func InitialTables1

func InitialTables1() *gormigrate.Migration

InitialTables1 returns the migration for creating the initial table.

func PrepareMigrations

func PrepareMigrations(db *database.DB) *gormigrate.Gormigrate

PrepareMigrations prepares all migrations.

func RollbackAll

func RollbackAll(migrator *gormigrate.Gormigrate) error

RollbackAll rolls back all migrations. The function is not provided by gormigrate.

Types

type AccessControl

type AccessControl struct {
	Base
	Name        string
	Description string
	XRole       []*Role `gorm:"many2many:access_controls_x_roles"`
}

AccessControl ...

type Account

type Account struct {
	Base
	UserID            uuid.UUID
	AccessTokenCredID uuid.UUID `gorm:"unique; type:uuid"`
	XApp              []*App    `gorm:"many2many:apps_x_accounts"`
}

Account ...

type App

type App struct {
	Base
	Name                string
	PublicID            uuid.UUID `gorm:"unique; type:uuid"`
	IsSecurityReviewed  bool
	IsOnAppEntityBehalf bool
	CreatorID           uuid.UUID
	AuthInfoID          uuid.UUID
	RESTHook            []RESTHook
	XRole               []*Role    `gorm:"many2many:apps_x_roles"`
	XAccount            []*Account `gorm:"many2many:apps_x_accounts"`
}

App ...

type AuthInfo

type AuthInfo struct {
	Base
	Name string
	Code datatypes.JSON
	App  App
}

AuthInfo ...

type Base

type Base struct {
	ID        uuid.UUID `gorm:"primary_key; unique; type:uuid; column:id; default:uuid_generate_v4()"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `gorm:"index"`
}

Base ...

type Engine

type Engine struct {
	Base
	WorkflowInstance []WorkflowInstance
}

Engine ...

type Folder

type Folder struct {
	Base
	Name        string
	Description string
	Avatar32URL string `gorm:"column:avatar_32_url"`
	CreatorID   uuid.UUID
	Workflow    []Workflow
}

Folder ...

type Group

type Group struct {
	Base
	Name        string
	Avatar32URL string `gorm:"column:avatar_32_url"`
	CreatorID   uuid.UUID
	XUser       []*User `gorm:"many2many:users_x_groups"`
}

Group ...

type Log

type Log struct {
	Base
	UserID             uuid.UUID
	EngineID           uuid.UUID
	WorkflowID         uuid.UUID
	WorkflowInstanceID uuid.UUID
	Message            string
	Level              string
}

Log ...

type Profile

type Profile struct {
	Base
	Username    string
	FirstName   string
	SecondName  string
	Email       string
	Avatar32URL string `gorm:"column:avatar_32_url"`
	UserID      uuid.UUID
}

Profile ...

type RESTHook

type RESTHook struct {
	Base
	UserID  uuid.UUID
	AppID   uuid.UUID
	HookURL string
}

RESTHook ...

type Role

type Role struct {
	Base
	Name           string
	Description    string
	XApp           []*App           `gorm:"many2many:apps_x_roles"`
	XUser          []*User          `gorm:"many2many:users_x_roles"`
	XAccessControl []*AccessControl `gorm:"many2many:access_controls_x_roles"`
	XTheme         []*Theme         `gorm:"many2many:themes_x_roles"`
	XWorkflow      []*Workflow      `gorm:"many2many:workflows_x_roles"`
}

Role ...

type SocialLogin

type SocialLogin struct {
	Base
	AppName string
	UserID  uuid.UUID
}

SocialLogin ...

type Theme

type Theme struct {
	Base
	Name      string
	Code      datatypes.JSON
	PublicID  uuid.UUID `gorm:"unique; type:uuid"`
	CreatorID uuid.UUID
	XRole     []*Role `gorm:"many2many:themes_x_roles"`
}

Theme ...

type User

type User struct {
	Base
	PasswordCredID uuid.UUID `gorm:"unique; type:uuid"`
	Profile        Profile
	SocialLogin    SocialLogin
	Account        []Account
	RESTHook       []RESTHook
	AppID          []App        `gorm:"foreignKey:CreatorID"`
	Group          []Group      `gorm:"foreignKey:CreatorID"`
	Workflow       []Workflow   `gorm:"foreignKey:CreatorID"`
	Workspace      []Workspace  `gorm:"foreignKey:CreatorID"`
	Folder         []Folder     `gorm:"foreignKey:CreatorID"`
	Theme          []Theme      `gorm:"foreignKey:CreatorID"`
	XGroup         []*Group     `gorm:"many2many:users_x_groups"`
	XWorkspace     []*Workspace `gorm:"many2many:users_x_workspaces"`
	XRole          []*Role      `gorm:"many2many:users_x_roles"`
}

User ...

type Workflow

type Workflow struct {
	Base
	Name             string
	Code             datatypes.JSON
	IsActive         bool
	IsDraft          bool
	FolderID         uuid.UUID
	CreatorID        uuid.UUID
	WorkflowInstance []WorkflowInstance
	XRole            []*Role `gorm:"many2many:workflows_x_roles"`
}

Workflow ...

type WorkflowInstance

type WorkflowInstance struct {
	Base
	CurrentTaskIndex int
	Dataflow         datatypes.JSON
	WorkflowID       uuid.UUID
	EngineID         uuid.UUID
}

WorkflowInstance ...

type Workspace

type Workspace struct {
	Base
	Name        string
	Avatar32URL string `gorm:"column:avatar_32_url"`
	CreatorID   uuid.UUID
	XUser       []*User `gorm:"many2many:users_x_workspaces"`
}

Workspace ...

Jump to

Keyboard shortcuts

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