@@ -52,25 +52,21 @@ type Contact struct {
52
52
CreatedOn_ time.Time `db:"created_on"`
53
53
ModifiedOn_ time.Time `db:"modified_on"`
54
54
55
- CreatedBy_ int `db:"created_by_id"`
56
- ModifiedBy_ int `db:"modified_by_id"`
57
-
58
55
IsNew_ bool
59
56
}
60
57
61
58
// UUID returns the UUID for this contact
62
59
func (c * Contact ) UUID () courier.ContactUUID { return c .UUID_ }
63
60
64
- const insertContactSQL = `
61
+ const sqlInsertContact = `
65
62
INSERT INTO
66
- contacts_contact(org_id, is_active, status, uuid, created_on, modified_on, created_by_id, modified_by_id, name, ticket_count)
67
- VALUES(:org_id, TRUE, 'A', :uuid, :created_on, :modified_on, :created_by_id, :modified_by_id, :name, 0)
68
- RETURNING id
69
- `
63
+ contacts_contact( org_id, is_active, status, uuid, created_on, modified_on, name, ticket_count)
64
+ VALUES(:org_id, TRUE, 'A', :uuid, :created_on, :modified_on, :name, 0)
65
+ RETURNING id`
70
66
71
67
// insertContact inserts the passed in contact, the id field will be populated with the result on success
72
68
func insertContact (tx * sqlx.Tx , contact * Contact ) error {
73
- rows , err := tx .NamedQuery (insertContactSQL , contact )
69
+ rows , err := tx .NamedQuery (sqlInsertContact , contact )
74
70
if err != nil {
75
71
return err
76
72
}
@@ -166,10 +162,6 @@ func contactForURN(ctx context.Context, b *backend, org OrgID, channel *Channel,
166
162
}
167
163
}
168
164
169
- // TODO: Set these to a system user
170
- contact .CreatedBy_ = 1
171
- contact .ModifiedBy_ = 1
172
-
173
165
// insert it
174
166
tx , err := b .db .BeginTxx (ctx , nil )
175
167
if err != nil {
0 commit comments