Rework phone subscription at the database layer so that we have a seprate phone status and subscriptions to district communications.
132 lines
3.4 KiB
Go
132 lines
3.4 KiB
Go
// 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 DistrictSubscriptionPhones = Table[
|
|
districtSubscriptionPhoneColumns,
|
|
districtSubscriptionPhoneIndexes,
|
|
districtSubscriptionPhoneForeignKeys,
|
|
districtSubscriptionPhoneUniques,
|
|
districtSubscriptionPhoneChecks,
|
|
]{
|
|
Schema: "",
|
|
Name: "district_subscription_phone",
|
|
Columns: districtSubscriptionPhoneColumns{
|
|
OrganizationID: column{
|
|
Name: "organization_id",
|
|
DBType: "integer",
|
|
Default: "",
|
|
Comment: "",
|
|
Nullable: false,
|
|
Generated: false,
|
|
AutoIncr: false,
|
|
},
|
|
PhoneE164: column{
|
|
Name: "phone_e164",
|
|
DBType: "text",
|
|
Default: "",
|
|
Comment: "",
|
|
Nullable: false,
|
|
Generated: false,
|
|
AutoIncr: false,
|
|
},
|
|
},
|
|
Indexes: districtSubscriptionPhoneIndexes{
|
|
DistrictSubscriptionPhonePkey: index{
|
|
Type: "btree",
|
|
Name: "district_subscription_phone_pkey",
|
|
Columns: []indexColumn{
|
|
{
|
|
Name: "organization_id",
|
|
Desc: null.FromCond(false, true),
|
|
IsExpression: false,
|
|
},
|
|
{
|
|
Name: "phone_e164",
|
|
Desc: null.FromCond(false, true),
|
|
IsExpression: false,
|
|
},
|
|
},
|
|
Unique: true,
|
|
Comment: "",
|
|
NullsFirst: []bool{false, false},
|
|
NullsDistinct: false,
|
|
Where: "",
|
|
Include: []string{},
|
|
},
|
|
},
|
|
PrimaryKey: &constraint{
|
|
Name: "district_subscription_phone_pkey",
|
|
Columns: []string{"organization_id", "phone_e164"},
|
|
Comment: "",
|
|
},
|
|
ForeignKeys: districtSubscriptionPhoneForeignKeys{
|
|
DistrictSubscriptionPhoneDistrictSubscriptionPhoneOrganizationIDFkey: foreignKey{
|
|
constraint: constraint{
|
|
Name: "district_subscription_phone.district_subscription_phone_organization_id_fkey",
|
|
Columns: []string{"organization_id"},
|
|
Comment: "",
|
|
},
|
|
ForeignTable: "organization",
|
|
ForeignColumns: []string{"id"},
|
|
},
|
|
DistrictSubscriptionPhoneDistrictSubscriptionPhonePhoneE164Fkey: foreignKey{
|
|
constraint: constraint{
|
|
Name: "district_subscription_phone.district_subscription_phone_phone_e164_fkey",
|
|
Columns: []string{"phone_e164"},
|
|
Comment: "",
|
|
},
|
|
ForeignTable: "comms.phone",
|
|
ForeignColumns: []string{"e164"},
|
|
},
|
|
},
|
|
|
|
Comment: "",
|
|
}
|
|
|
|
type districtSubscriptionPhoneColumns struct {
|
|
OrganizationID column
|
|
PhoneE164 column
|
|
}
|
|
|
|
func (c districtSubscriptionPhoneColumns) AsSlice() []column {
|
|
return []column{
|
|
c.OrganizationID, c.PhoneE164,
|
|
}
|
|
}
|
|
|
|
type districtSubscriptionPhoneIndexes struct {
|
|
DistrictSubscriptionPhonePkey index
|
|
}
|
|
|
|
func (i districtSubscriptionPhoneIndexes) AsSlice() []index {
|
|
return []index{
|
|
i.DistrictSubscriptionPhonePkey,
|
|
}
|
|
}
|
|
|
|
type districtSubscriptionPhoneForeignKeys struct {
|
|
DistrictSubscriptionPhoneDistrictSubscriptionPhoneOrganizationIDFkey foreignKey
|
|
DistrictSubscriptionPhoneDistrictSubscriptionPhonePhoneE164Fkey foreignKey
|
|
}
|
|
|
|
func (f districtSubscriptionPhoneForeignKeys) AsSlice() []foreignKey {
|
|
return []foreignKey{
|
|
f.DistrictSubscriptionPhoneDistrictSubscriptionPhoneOrganizationIDFkey, f.DistrictSubscriptionPhoneDistrictSubscriptionPhonePhoneE164Fkey,
|
|
}
|
|
}
|
|
|
|
type districtSubscriptionPhoneUniques struct{}
|
|
|
|
func (u districtSubscriptionPhoneUniques) AsSlice() []constraint {
|
|
return []constraint{}
|
|
}
|
|
|
|
type districtSubscriptionPhoneChecks struct{}
|
|
|
|
func (c districtSubscriptionPhoneChecks) AsSlice() []check {
|
|
return []check{}
|
|
}
|