You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: This should all be prepared statements, but that breaks for some reason
78
-
PreparedStatementdatabaseStatement = connection.get().prepareStatement("CREATE DATABASE IF NOT EXISTS " + database);
79
-
databaseStatement.execute();
80
-
databaseStatement.close();
95
+
if (!isUsingSqlite) {
96
+
PreparedStatementdatabaseStatement = connection.get().prepareStatement("CREATE DATABASE IF NOT EXISTS " + database);
97
+
databaseStatement.execute();
98
+
databaseStatement.close();
99
+
}
81
100
82
-
PreparedStatementgroupMembersStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + ".groupMembers (uuid VARCHAR(767) NOT NULL, `group` VARCHAR(700) NOT NULL, `primary` TINYINT NOT NULL)");
101
+
PreparedStatementgroupMembersStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + "groupMembers (uuid VARCHAR(767) NOT NULL, `group` VARCHAR(700) NOT NULL, `primary` TINYINT NOT NULL)");
83
102
groupMembersStatement.execute();
84
103
groupMembersStatement.close();
85
104
86
-
PreparedStatementgroupPermissionsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database +".groupPermissions (groupName VARCHAR(767) NOT NULL, permission VARCHAR(767) NOT NULL)");
105
+
PreparedStatementgroupPermissionsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database +"groupPermissions (groupName VARCHAR(767) NOT NULL, permission VARCHAR(767) NOT NULL)");
87
106
groupPermissionsStatement.execute();
88
107
groupPermissionsStatement.close();
89
108
90
-
PreparedStatementgroupsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + ".groups (name VARCHAR(100) NOT NULL UNIQUE, prefix VARCHAR(100) NOT NULL, suffix VARCHAR(100) NOT NULL, chatcolor VARCHAR(4) NOT NULL, defaultGroup TINYINT NOT NULL)");
109
+
PreparedStatementgroupsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + "groups (name VARCHAR(100) NOT NULL UNIQUE, prefix VARCHAR(100) NOT NULL, suffix VARCHAR(100) NOT NULL, chatcolor VARCHAR(4) NOT NULL, defaultGroup TINYINT NOT NULL)");
91
110
groupsStatement.execute();
92
111
groupsStatement.close();
93
112
94
-
PreparedStatementplayerPermissionsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + ".playerPermissions (uuid VARCHAR(767) NOT NULL, permission VARCHAR(767) NOT NULL, granted TINYINT NOT NULL)");
113
+
PreparedStatementplayerPermissionsStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + "playerPermissions (uuid VARCHAR(767) NOT NULL, permission VARCHAR(767) NOT NULL, granted TINYINT NOT NULL)");
95
114
playerPermissionsStatement.execute();
96
115
playerPermissionsStatement.close();
97
116
98
-
PreparedStatementsuperAdminStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + ".superAdmin (uuid VARCHAR(767) NOT NULL)");
117
+
PreparedStatementsuperAdminStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + "superAdmin (uuid VARCHAR(767) NOT NULL)");
PreparedStatementformattingStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + ".formatting (`format` VARCHAR(400) NOT NULL, formatter VARCHAR(200) NOT NULL)");
121
+
if (!hasFormattingTable(connection.get(), database)) {
122
+
PreparedStatementformattingStatement = connection.get().prepareStatement("CREATE TABLE IF NOT EXISTS " + database + "formatting (`format` VARCHAR(400) NOT NULL, formatter VARCHAR(200) NOT NULL)");
0 commit comments