// Code generated by BobGen psql v0.42.5. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

package dbinfo

import "github.com/aarondl/opt/null"

var Users = Table[
	userColumns,
	userIndexes,
	userForeignKeys,
	userUniques,
	userChecks,
]{
	Schema: "",
	Name:   "user_",
	Columns: userColumns{
		ID: column{
			Name:      "id",
			DBType:    "integer",
			Default:   "nextval('user__id_seq'::regclass)",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		ArcgisAccessToken: column{
			Name:      "arcgis_access_token",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ArcgisLicense: column{
			Name:      "arcgis_license",
			DBType:    "public.arcgislicensetype",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ArcgisRefreshToken: column{
			Name:      "arcgis_refresh_token",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ArcgisRefreshTokenExpires: column{
			Name:      "arcgis_refresh_token_expires",
			DBType:    "timestamp without time zone",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ArcgisRole: column{
			Name:      "arcgis_role",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		DisplayName: column{
			Name:      "display_name",
			DBType:    "character varying",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Email: column{
			Name:      "email",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		OrganizationID: column{
			Name:      "organization_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Username: column{
			Name:      "username",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		PasswordHashType: column{
			Name:      "password_hash_type",
			DBType:    "public.hashtype",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		PasswordHash: column{
			Name:      "password_hash",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Role: column{
			Name:      "role",
			DBType:    "public.userrole",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Avatar: column{
			Name:      "avatar",
			DBType:    "uuid",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		IsActive: column{
			Name:      "is_active",
			DBType:    "boolean",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		IsDronePilot: column{
			Name:      "is_drone_pilot",
			DBType:    "boolean",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		IsWarrant: column{
			Name:      "is_warrant",
			DBType:    "boolean",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: userIndexes{
		UserPkey: index{
			Type: "btree",
			Name: "user__pkey",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
		UserUsernameUnique: index{
			Type: "btree",
			Name: "user_username_unique",
			Columns: []indexColumn{
				{
					Name:         "username",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "user__pkey",
		Columns: []string{"id"},
		Comment: "",
	},
	ForeignKeys: userForeignKeys{
		UserUserOrganizationIDFkey: foreignKey{
			constraint: constraint{
				Name:    "user_.user__organization_id_fkey",
				Columns: []string{"organization_id"},
				Comment: "",
			},
			ForeignTable:   "organization",
			ForeignColumns: []string{"id"},
		},
	},
	Uniques: userUniques{
		UserUsernameUnique: constraint{
			Name:    "user_username_unique",
			Columns: []string{"username"},
			Comment: "",
		},
	},

	Comment: "",
}

type userColumns struct {
	ID                        column
	ArcgisAccessToken         column
	ArcgisLicense             column
	ArcgisRefreshToken        column
	ArcgisRefreshTokenExpires column
	ArcgisRole                column
	DisplayName               column
	Email                     column
	OrganizationID            column
	Username                  column
	PasswordHashType          column
	PasswordHash              column
	Role                      column
	Avatar                    column
	IsActive                  column
	IsDronePilot              column
	IsWarrant                 column
}

func (c userColumns) AsSlice() []column {
	return []column{
		c.ID, c.ArcgisAccessToken, c.ArcgisLicense, c.ArcgisRefreshToken, c.ArcgisRefreshTokenExpires, c.ArcgisRole, c.DisplayName, c.Email, c.OrganizationID, c.Username, c.PasswordHashType, c.PasswordHash, c.Role, c.Avatar, c.IsActive, c.IsDronePilot, c.IsWarrant,
	}
}

type userIndexes struct {
	UserPkey           index
	UserUsernameUnique index
}

func (i userIndexes) AsSlice() []index {
	return []index{
		i.UserPkey, i.UserUsernameUnique,
	}
}

type userForeignKeys struct {
	UserUserOrganizationIDFkey foreignKey
}

func (f userForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.UserUserOrganizationIDFkey,
	}
}

type userUniques struct {
	UserUsernameUnique constraint
}

func (u userUniques) AsSlice() []constraint {
	return []constraint{
		u.UserUsernameUnique,
	}
}

type userChecks struct{}

func (c userChecks) AsSlice() []check {
	return []check{}
}
