The following SQL query will have to be run in order to add default values to existing tables:
Query
```
/* Add default values to existing table */
ALTER TABLE wiiu.user_data
ALTER COLUMN show_online SET DEFAULT true,
ALTER COLUMN show_current_game SET DEFAULT true,
ALTER COLUMN block_friend_requests SET DEFAULT false,
ALTER COLUMN comment SET DEFAULT '',
ALTER COLUMN comment_changed SET DEFAULT 0;
/* Update existing NULL values to defaults */
UPDATE wiiu.user_data SET show_online = true WHERE show_online IS NULL;
UPDATE wiiu.user_data SET show_current_game = true WHERE show_current_game IS NULL;
UPDATE wiiu.user_data SET block_friend_requests = false WHERE block_friend_requests IS NULL;
UPDATE wiiu.user_data SET comment = '' WHERE comment IS NULL;
UPDATE wiiu.user_data SET comment_changed = 0 WHERE comment_changed IS NULL;
/* 3DS */
ALTER TABLE "3ds".user_data
ALTER COLUMN show_online SET DEFAULT true,
ALTER COLUMN show_current_game SET DEFAULT true;
UPDATE "3ds".user_data SET show_online = true WHERE show_online IS NULL;
UPDATE "3ds".user_data SET show_current_game = true WHERE show_current_game IS NULL;
```
This should probably go somewhere in the repo, however I'm unsure of how I should go about that.
This PR adds:
The following SQL query will have to be run in order to add default values to existing tables:
Query
``` /* Add default values to existing table */ ALTER TABLE wiiu.user_data ALTER COLUMN show_online SET DEFAULT true, ALTER COLUMN show_current_game SET DEFAULT true, ALTER COLUMN block_friend_requests SET DEFAULT false, ALTER COLUMN comment SET DEFAULT '', ALTER COLUMN comment_changed SET DEFAULT 0; /* Update existing NULL values to defaults */ UPDATE wiiu.user_data SET show_online = true WHERE show_online IS NULL; UPDATE wiiu.user_data SET show_current_game = true WHERE show_current_game IS NULL; UPDATE wiiu.user_data SET block_friend_requests = false WHERE block_friend_requests IS NULL; UPDATE wiiu.user_data SET comment = '' WHERE comment IS NULL; UPDATE wiiu.user_data SET comment_changed = 0 WHERE comment_changed IS NULL; /* 3DS */ ALTER TABLE "3ds".user_data ALTER COLUMN show_online SET DEFAULT true, ALTER COLUMN show_current_game SET DEFAULT true; UPDATE "3ds".user_data SET show_online = true WHERE show_online IS NULL; UPDATE "3ds".user_data SET show_current_game = true WHERE show_current_game IS NULL; ```This should probably go somewhere in the repo, however I'm unsure of how I should go about that.