Last active
March 21, 2020 10:13
-
-
Save Androz2091/efa73866f59db6c2483821d2b559b26f to your computer and use it in GitHub Desktop.
Requetes pour préparer le base de données de manage invite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE members SET id = user_id ||'-'|| guild_id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE members | |
ALTER column seq SET default nextval('members_id_seq'); | |
UPDATE members SET seq=nextval('members_id_seq'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM members | |
WHERE seq IN | |
(SELECT seq | |
FROM | |
(SELECT seq, | |
ROW_NUMBER() OVER( PARTITION BY id | |
ORDER BY id ) AS row_num | |
FROM members ) t | |
WHERE t.row_num > 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM member_join_data WHERE join_type = 'perm'; | |
UPDATE member_join_data SET join_invite_data = null WHERE join_invite_data = 'null' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM members | |
WHERE invites_fake = 0 | |
AND invites_bonus = 0 | |
AND invites_leaves = 0 | |
AND invites_regular = 0 | |
AND old_invites_fake = 0 | |
AND old_invites_bonus = 0 | |
AND old_invites_leaves = 0 | |
AND old_invites_regular = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment