// 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 CommsEmailLogs = Table[
	commsEmailLogColumns,
	commsEmailLogIndexes,
	commsEmailLogForeignKeys,
	commsEmailLogUniques,
	commsEmailLogChecks,
]{
	Schema: "comms",
	Name:   "email_log",
	Columns: commsEmailLogColumns{
		ID: column{
			Name:      "id",
			DBType:    "integer",
			Default:   "nextval('comms.email_log_id_seq'::regclass)",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Created: column{
			Name:      "created",
			DBType:    "timestamp without time zone",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		DeliveryStatus: column{
			Name:      "delivery_status",
			DBType:    "character varying",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Destination: column{
			Name:      "destination",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		PublicID: column{
			Name:      "public_id",
			DBType:    "character varying",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		SentAt: column{
			Name:      "sent_at",
			DBType:    "timestamp without time zone",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		Source: column{
			Name:      "source",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Subject: column{
			Name:      "subject",
			DBType:    "character varying",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		TemplateID: column{
			Name:      "template_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		TemplateData: column{
			Name:      "template_data",
			DBType:    "hstore",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Type: column{
			Name:      "type",
			DBType:    "comms.messagetypeemail",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: commsEmailLogIndexes{
		EmailLogPkey: index{
			Type: "btree",
			Name: "email_log_pkey",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "email_log_pkey",
		Columns: []string{"id"},
		Comment: "",
	},
	ForeignKeys: commsEmailLogForeignKeys{
		CommsEmailLogEmailLogDestinationFkey: foreignKey{
			constraint: constraint{
				Name:    "comms.email_log.email_log_destination_fkey",
				Columns: []string{"destination"},
				Comment: "",
			},
			ForeignTable:   "comms.email_contact",
			ForeignColumns: []string{"address"},
		},
		CommsEmailLogEmailLogTemplateIDFkey: foreignKey{
			constraint: constraint{
				Name:    "comms.email_log.email_log_template_id_fkey",
				Columns: []string{"template_id"},
				Comment: "",
			},
			ForeignTable:   "comms.email_template",
			ForeignColumns: []string{"id"},
		},
	},

	Comment: "",
}

type commsEmailLogColumns struct {
	ID             column
	Created        column
	DeliveryStatus column
	Destination    column
	PublicID       column
	SentAt         column
	Source         column
	Subject        column
	TemplateID     column
	TemplateData   column
	Type           column
}

func (c commsEmailLogColumns) AsSlice() []column {
	return []column{
		c.ID, c.Created, c.DeliveryStatus, c.Destination, c.PublicID, c.SentAt, c.Source, c.Subject, c.TemplateID, c.TemplateData, c.Type,
	}
}

type commsEmailLogIndexes struct {
	EmailLogPkey index
}

func (i commsEmailLogIndexes) AsSlice() []index {
	return []index{
		i.EmailLogPkey,
	}
}

type commsEmailLogForeignKeys struct {
	CommsEmailLogEmailLogDestinationFkey foreignKey
	CommsEmailLogEmailLogTemplateIDFkey  foreignKey
}

func (f commsEmailLogForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.CommsEmailLogEmailLogDestinationFkey, f.CommsEmailLogEmailLogTemplateIDFkey,
	}
}

type commsEmailLogUniques struct{}

func (u commsEmailLogUniques) AsSlice() []constraint {
	return []constraint{}
}

type commsEmailLogChecks struct{}

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