migrations

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsersRoleSample = &UsersRole{
	RoleUUID:  "a387a8da-5f74-4858-bebe-ed6b0b805517",
	Name:      "Full",
	Write:     true,
	Delete:    true,
	CreatedAt: fmt.Sprintf("%v", time.Now().Unix()),
}

UsersRoleSample This variable used for create a default row at users_role table

View Source
var UsersSample = &Users{
	UserUUID:  uuid.New().String(),
	Username:  "administrator",
	Email:     "[email protected]",
	Fullname:  "Administrator",
	Password:  "$2a$04$mR9beQW74XYy8Q.PWBDQ1u925U.SjW8s6FtuW75j4aAOCvWtf48rO",
	Role:      "a387a8da-5f74-4858-bebe-ed6b0b805517",
	CreatedAt: fmt.Sprintf("%v", time.Now().Unix()),
}

UsersSample This variable used for create a default row at users table

Functions

This section is empty.

Types

type Users

type Users struct {
	ID        int    `pg:",pk"`
	UserUUID  string `pg:"type:uuid,nopk,notnull,unique" json:"user_uuid,omitempty"`
	Username  string `pg:"type:varchar(50),notnull,unique" json:"username,omitempty"`
	Email     string `pg:"type:varchar(50),notnull,unique" json:"email,omitempty"`
	Fullname  string `pg:"type:varchar(255),notnull" json:"fullname,omitempty"`
	Password  string `pg:"type:varchar(60),notnull" json:"password,omitempty"`
	Role      string `pg:"type:uuid,nopk,notnull" json:"role,omitempty"`
	CreatedAt string `pg:"type:varchar(10),notnull" json:"created_at,omitempty"`  // use unixtime
	UpdatedAt string `pg:"type:varchar(10),use_zero" json:"updated_at,omitempty"` // use unixtime
}

Users table, references to users

type UsersRole

type UsersRole struct {
	ID        int    `pg:",pk"`
	RoleUUID  string `pg:"type:uuid,nopk,notnull,unique" json:"role_uuid,omitempty"`
	Name      string `pg:"type:varchar(100),notnull" json:"name,omitempty"`
	Write     bool   `pg:"type:bool" json:"write,omitempty"`
	Delete    bool   `pg:"type:bool" json:"delete,omitempty"`
	CreatedAt string `pg:"type:varchar(10),notnull" json:"created_at,omitempty"`  // use unixtime
	UpdatedAt string `pg:"type:varchar(10),use_zero" json:"updated_at,omitempty"` // use unixtime
}

UsersRole table references to users_table

Jump to

Keyboard shortcuts

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