Alter "accountPreferences" table to include a new column "showUserReports".

This commit is contained in:
Keir 2015-11-10 11:38:13 +00:00
parent e00c11ae28
commit 217ac78d49
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ public class PreferencesRepository extends RepositoryBase
//private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS accountPreferences (id INT NOT NULL AUTO_INCREMENT, uuid VARCHAR(256), games BOOL NOT NULL DEFAULT 1, visibility BOOL NOT NULL DEFAULT 1, showChat BOOL NOT NULL DEFAULT 1, friendChat BOOL NOT NULL DEFAULT 1, privateMessaging BOOL NOT NULL DEFAULT 1, partyRequests BOOL NOT NULL DEFAULT 0, invisibility BOOL NOT NULL DEFAULT 0, forcefield BOOL NOT NULL DEFAULT 0, showMacReports BOOL NOT NULL DEFAULT 0, ignoreVelocity BOOL NOT NULL DEFAULT 0, showUserReports BOOL NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE INDEX uuid_index (uuid));";
private static String INSERT_ACCOUNT = "INSERT INTO accountPreferences (uuid) VALUES (?) ON DUPLICATE KEY UPDATE uuid=uuid;";
private static String UPDATE_ACCOUNT_PREFERENCES = "UPDATE accountPreferences SET games = ?, visibility = ?, showChat = ?, friendChat = ?, privateMessaging = ?, partyRequests = ?, invisibility = ?, forcefield = ?, showMacReports = ?, ignoreVelocity = ?, pendingFriendRequests = ?, friendDisplayInventoryUI = ?, showUserReports = ? WHERE uuid=?;";
private static String ADD_USER_REPORTS_COLUMN = "ALTER TABLE accountPreferences ADD showUserReports BOOL DEFAULT 0 NOT NULL;";
public PreferencesRepository(JavaPlugin plugin)
{
@ -28,6 +29,7 @@ public class PreferencesRepository extends RepositoryBase
protected void initialize()
{
//executeUpdate(CREATE_ACCOUNT_TABLE);
executeUpdate(ADD_USER_REPORTS_COLUMN);
}
@Override