-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
telegram_user_id/telegram_bot_id fields #147
Conversation
…e used at ModifyUser endpoint.
users/users_modify.go
Outdated
@@ -298,6 +300,16 @@ func (u *User) genSQLUpdate(ctx context.Context, agendaUserIDs []UserID) (sql st | |||
sql += fmt.Sprintf(", agenda_contact_user_ids = $%v", nextIndex) | |||
nextIndex++ | |||
} | |||
if u.TelegramUserID != nil && *u.TelegramUserID != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U also need to allow removal of those fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then they are need to have userID values by default, and I need to add new boolean ClearTelegramInfo field to set them to userID to reset them, right?
…rID. Made telegram_user_id unique field.
@@ -15,6 +15,7 @@ CREATE TABLE IF NOT EXISTS users ( | |||
email text NOT NULL UNIQUE, | |||
first_name text, | |||
last_name text, | |||
telegram_bot_id text, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not null
VALUES (current_timestamp,current_timestamp,'bogus','bogus','bogus','bogus','bogus','bogus.jpg','bogus','bogus','RO','bogus','bogus',to_tsvector('bogus')), | ||
(current_timestamp,current_timestamp,'%[1]v','%[1]v','%[1]v','%[1]v','%[1]v','%[1]v.jpg','%[1]v','%[1]v','RO','%[1]v','%[1]v',to_tsvector('%[1]v')), | ||
(current_timestamp,current_timestamp,'icenetwork','icenetwork','icenetwork','icenetwork','icenetwork','icenetwork.jpg','icenetwork','icenetwork','RO','icenetwork','icenetwork',to_tsvector('icenetwork')) | ||
ALTER TABLE users ADD COLUMN IF NOT EXISTS telegram_user_id text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text not null
(current_timestamp,current_timestamp,'%[1]v','%[1]v','%[1]v','%[1]v','%[1]v','%[1]v.jpg','%[1]v','%[1]v','RO','%[1]v','%[1]v',to_tsvector('%[1]v')), | ||
(current_timestamp,current_timestamp,'icenetwork','icenetwork','icenetwork','icenetwork','icenetwork','icenetwork.jpg','icenetwork','icenetwork','RO','icenetwork','icenetwork',to_tsvector('icenetwork')) | ||
ALTER TABLE users ADD COLUMN IF NOT EXISTS telegram_user_id text; | ||
ALTER TABLE users ADD COLUMN IF NOT EXISTS telegram_bot_id text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text not null
telegram_user_id/telegram_bot_id fields and to be used at ModifyUser endpoint.