Live Free
Active member
I have a xf_user column that has data from an old custom add-on. I'd like to modify the number value of this field and then import it into a column for a new add-on. I'm not familiar with SQL commands, but after a little research, this is what I came up with:
Takes old add-on data, where users have earned a post credit, and reduces by 100x. (necessary due to how old add-on counted data). 8000 credits becomes 80 credits, and so on.
Copies data from old post_quota to new column.
I'm sure this is quite crude, am I close? I could use some guidance. Much thanks.
EDIT: first column ins INT(10), second column is double.
Code:
UPDATE xf_user set post_quota = post_quota *.01
Takes old add-on data, where users have earned a post credit, and reduces by 100x. (necessary due to how old add-on counted data). 8000 credits becomes 80 credits, and so on.
Code:
UPDATE xf_user SET db_credits = post_quota WHERE xf_user.post_quota > 0
Copies data from old post_quota to new column.
I'm sure this is quite crude, am I close? I could use some guidance. Much thanks.
EDIT: first column ins INT(10), second column is double.
Last edited: