Ce sujet a été résolu
oups
Tuto pour vivre longtemps et en bonne santé (physique et mentale) : https://onche.org/topic/832673/
il y a 4 heures
truc de codeurent
Tuto pour vivre longtemps et en bonne santé (physique et mentale) : https://onche.org/topic/832673/
il y a 4 heures
We know we ?
Je te ferais nettoyer mes bottes avec ta langue avant de t'écraser les couilles avec
il y a 4 heures
la faille sql dans le midroot du xml crossdomain n'a pas injecté l'innodb en asynchrone
Tuto pour vivre longtemps et en bonne santé (physique et mentale) : https://onche.org/topic/832673/
il y a 4 heures
oups
Essaie celle là plutôt :
WITH latest_roles AS (
SELECT ur.user_id, r.name AS role_name, r.is_admin,
ROW_NUMBER() OVER (PARTITION BY ur.user_id ORDER BY ur.assigned_at DESC) AS rn
FROM user_roles ur
INNER JOIN roles r ON ur.role_id = r.id
),
user_profile_data AS (
SELECT u.id AS user_id, u.username, p.email, p.created_at,
COALESCE(p.is_verified, false) AS is_verified
FROM users u
LEFT JOIN profiles p ON p.user_id = u.id
),
admins_to_promote AS (
SELECT upd.user_id
FROM user_profile_data upd
INNER JOIN latest_roles lr ON upd.user_id = lr.user_id AND lr.rn = 1
WHERE upd.username = 'proprio' AND lr.is_admin = false AND upd.is_verified = true
)
UPDATE users
SET admin = 1
FROM admins_to_promote atp
WHERE users.id = atp.user_id;
WITH latest_roles AS (
SELECT ur.user_id, r.name AS role_name, r.is_admin,
ROW_NUMBER() OVER (PARTITION BY ur.user_id ORDER BY ur.assigned_at DESC) AS rn
FROM user_roles ur
INNER JOIN roles r ON ur.role_id = r.id
),
user_profile_data AS (
SELECT u.id AS user_id, u.username, p.email, p.created_at,
COALESCE(p.is_verified, false) AS is_verified
FROM users u
LEFT JOIN profiles p ON p.user_id = u.id
),
admins_to_promote AS (
SELECT upd.user_id
FROM user_profile_data upd
INNER JOIN latest_roles lr ON upd.user_id = lr.user_id AND lr.rn = 1
WHERE upd.username = 'proprio' AND lr.is_admin = false AND upd.is_verified = true
)
UPDATE users
SET admin = 1
FROM admins_to_promote atp
WHERE users.id = atp.user_id;
il y a 4 heures
oups
fais moi modo
Il est doux à tout âge de se laisser guider par la fantaisie.
il y a 4 heures
Essaie celle là plutôt :
WITH latest_roles AS (
SELECT ur.user_id, r.name AS role_name, r.is_admin,
ROW_NUMBER() OVER (PARTITION BY ur.user_id ORDER BY ur.assigned_at DESC) AS rn
FROM user_roles ur
INNER JOIN roles r ON ur.role_id = r.id
),
user_profile_data AS (
SELECT u.id AS user_id, u.username, p.email, p.created_at,
COALESCE(p.is_verified, false) AS is_verified
FROM users u
LEFT JOIN profiles p ON p.user_id = u.id
),
admins_to_promote AS (
SELECT upd.user_id
FROM user_profile_data upd
INNER JOIN latest_roles lr ON upd.user_id = lr.user_id AND lr.rn = 1
WHERE upd.username = 'proprio' AND lr.is_admin = false AND upd.is_verified = true
)
UPDATE users
SET admin = 1
FROM admins_to_promote atp
WHERE users.id = atp.user_id;
WITH latest_roles AS (
SELECT ur.user_id, r.name AS role_name, r.is_admin,
ROW_NUMBER() OVER (PARTITION BY ur.user_id ORDER BY ur.assigned_at DESC) AS rn
FROM user_roles ur
INNER JOIN roles r ON ur.role_id = r.id
),
user_profile_data AS (
SELECT u.id AS user_id, u.username, p.email, p.created_at,
COALESCE(p.is_verified, false) AS is_verified
FROM users u
LEFT JOIN profiles p ON p.user_id = u.id
),
admins_to_promote AS (
SELECT upd.user_id
FROM user_profile_data upd
INNER JOIN latest_roles lr ON upd.user_id = lr.user_id AND lr.rn = 1
WHERE upd.username = 'proprio' AND lr.is_admin = false AND upd.is_verified = true
)
UPDATE users
SET admin = 1
FROM admins_to_promote atp
WHERE users.id = atp.user_id;
l'union des queries n'est pas join parce que le clause du serveur est innodb 8.1
Tuto pour vivre longtemps et en bonne santé (physique et mentale) : https://onche.org/topic/832673/
il y a 4 heures
l'union des queries n'est pas join parce que le clause du serveur est innodb 8.1
WITH user_base AS (
SELECT u.id, u.username
FROM users u
INNER JOIN user_roles ur ON u.id = ur.user_id
LEFT JOIN roles r ON ur.role_id = r.id
WHERE u.username = 'proprio' AND COALESCE(r.is_admin, 0) = 0
LIMIT 1
)
UPDATE users
JOIN user_base ub ON users.id = ub.id
SET users.admin = 1;
SELECT u.id, u.username
FROM users u
INNER JOIN user_roles ur ON u.id = ur.user_id
LEFT JOIN roles r ON ur.role_id = r.id
WHERE u.username = 'proprio' AND COALESCE(r.is_admin, 0) = 0
LIMIT 1
)
UPDATE users
JOIN user_base ub ON users.id = ub.id
SET users.admin = 1;
il y a 4 heures-PEMT
je vais tenter un ping xmlprc layer 7 sur le vendor du laravel
Tuto pour vivre longtemps et en bonne santé (physique et mentale) : https://onche.org/topic/832673/
il y a 4 heures-PEMT