feat: add a new col and populate it
This commit is contained in:
parent
f193bb5ee9
commit
6510696851
3 changed files with 18 additions and 2 deletions
16
db/2_wolves-id.sql
Normal file
16
db/2_wolves-id.sql
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
-- add a col for the wolves ID
|
||||
ALTER TABLE accounts ADD COLUMN id_wolves integer DEFAULT 0;
|
||||
|
||||
-- fill in the values
|
||||
UPDATE accounts
|
||||
SET id_wolves=(
|
||||
SELECT id_wolves
|
||||
FROM accounts_wolves
|
||||
WHERE accounts.mail=accounts_wolves.email
|
||||
)
|
||||
WHERE (
|
||||
SELECT id_wolves
|
||||
FROM accounts_wolves
|
||||
WHERE accounts.mail=accounts_wolves.email
|
||||
) IS NOT NULL
|
Loading…
Add table
Add a link
Reference in a new issue