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
Create record for all watched topics and boards during upgrade #6683
Conversation
Yes
________________________________
Von: BrickOzp ***@***.***>
Gesendet: Montag, 12. April 2021 07:43
An: SimpleMachines/SMF2.1
Cc: albertlast; Comment
Betreff: Re: [SimpleMachines/SMF2.1] Create record for all watched topics and boards during upgrade (#6683)
@BrickOzp commented on this pull request.
________________________________
In other/upgrade_2-1_postgresql.sql<#6683 (comment)>:
+ FROM {db_prefix}log_notify
+ WHERE id_member <> 0 AND id_topic <> 0
+ LIMIT {int:start}, {int:limit}',
+ array(
+ 'db_error_skip' => true,
+ 'start' => $_GET['a'],
+ 'limit' => $limit,
+ )
+ );
+ if ($smcFunc['db_num_rows']($request) != 0)
+ {
+ while ($row = $smcFunc['db_fetch_assoc']($request))
+ {
+ $inserts[] = array($row['id_member'], 'topic_notify_' . $row['id_topic'], 1);
+ }
+ $smcFunc['db_free_result']($request);
Do you mean that the call should be outside of the if case?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6683 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AANTI6QQBJGYMVYXTIZ4XULTIKCAHANCNFSM42UO2LTQ>.
|
In fetch_all not ,
But in the select, look at sql code.
________________________________
Von: BrickOzp ***@***.***>
Gesendet: Montag, 12. April 2021 07:44
An: SimpleMachines/SMF2.1
Cc: albertlast; Comment
Betreff: Re: [SimpleMachines/SMF2.1] Create record for all watched topics and boards during upgrade (#6683)
@BrickOzp commented on this pull request.
________________________________
In other/upgrade_2-1_postgresql.sql<#6683 (comment)>:
+ $request = $smcFunc['db_query']('', '
+ SELECT id_member, id_topic
+ FROM {db_prefix}log_notify
+ WHERE id_member <> 0 AND id_topic <> 0
+ LIMIT {int:start}, {int:limit}',
+ array(
+ 'db_error_skip' => true,
+ 'start' => $_GET['a'],
+ 'limit' => $limit,
+ )
+ );
+ if ($smcFunc['db_num_rows']($request) != 0)
+ {
+ while ($row = $smcFunc['db_fetch_assoc']($request))
+ {
+ $inserts[] = array($row['id_member'], 'topic_notify_' . $row['id_topic'], 1);
+ }
+ $smcFunc['db_free_result']($request);
We need to add 'topic_notify_' before the id_topic. Is that possible with fetch_all?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6683 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AANTI6SFLMVRMXH7HTDH7LLTIKCEJANCNFSM42UO2LTQ>.
|
56140d9
to
111ff80
Compare
other/upgrade_2-1_mysql.sql
Outdated
$inserts = array(); | ||
|
||
$request = $smcFunc['db_query']('', ' | ||
SELECT id_member, CONCAT(\'topic_notify_\', id_topic), 1 |
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.
i don't recommand to use concat, since it limit you to only two strings ->
\'topic_notify_\' || id_topic
or to make it clearer
(\'topic_notify_\' || id_topic)
also maybe a good idea to add an alias to make refer
(\'topic_notify_\' || id_topic) as alert_pref
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.
Is that a psql thing? When I tried it on mysql it only returned 1 so I went for concat instead.
If it works for psql is there a point in using different methods for psql/mysql?
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.
i didn't know that this is in mysql default disable: #6708
but than stay on concat, but still i would like to see that you provide an alias for this column.
This now requires #6708 to work |
The notification mode for watched topics and boards are stored in the user_alert_prefs table. These needs to be created when upgrading from 2.0 to 2.1 Fixes SimpleMachines#6665 Signed-off-by: Oscar Rydhé <oscar.rydhe@gmail.com>
This will remove the red color for these columns. Signed-off-by: Oscar Rydhé <oscar.rydhe@gmail.com>
This is needed for fix SimpleMachines#6683 Signed-off-by: Oscar Rydhé <oscar.rydhe@gmail.com>
This is needed for fix #6683 Signed-off-by: Oscar Rydhé <oscar.rydhe@gmail.com>
The notification mode for watched topics and boards
are stored in the user_alert_prefs table. These needs to be
created when upgrading from 2.0 to 2.1
Fixes #6665
Signed-off-by: Oscar Rydhé oscar.rydhe@gmail.com