Skip to content
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

Merged
merged 2 commits into from
Jun 17, 2024
Merged

Conversation

ice-myles
Copy link
Contributor

telegram_user_id/telegram_bot_id fields and to be used at ModifyUser endpoint.

@ice-myles ice-myles added the enhancement New feature or request label Jun 17, 2024
@ice-myles ice-myles self-assigned this Jun 17, 2024
@ice-myles ice-myles requested a review from a team as a code owner June 17, 2024 17:41
@ice-myles ice-myles enabled auto-merge (squash) June 17, 2024 17:41
@@ -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 != "" {
Copy link
Contributor

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

Copy link
Contributor Author

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?

@ice-ares ice-ares merged commit 393db8a into master Jun 17, 2024
19 checks passed
@ice-ares ice-ares deleted the feature/telegram-fields branch June 17, 2024 19:41
@@ -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,
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text not null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants