Revert "fix loop message issue"

This reverts commit 6eed16e0


Former-commit-id: 982a318d230d9603b4123fb208b659d49a9d272b
This commit is contained in:
Ghost_chu committed 2020-01-16 17:40:44 +08:00
1 parent 223f70907e
commit 153e46653a
1 file changed
+15
@@ -76,6 +76,17 @@ public class DatabaseHelper {
} catch (SQLException e) {
//ignore
}
if (QuickShop.instance.getDatabase().getCore() instanceof MySQLCore) {
try {
ps = db.getConnection().prepareStatement("ALTER TABLE " + QuickShop.instance
.getDbPrefix() + "messages MODIFY COLUMN message text CHARACTER SET utf8mb4 NOT NULL AFTER owner");
ps.execute();
ps.close();
} catch (SQLException e) {
//ignore
}
}
}
public void cleanMessage(long weekAgo) {
@@ -113,6 +124,10 @@ public class DatabaseHelper {
Statement st = db.getConnection().createStatement();
String createTable = "CREATE TABLE " + QuickShop.instance.getDbPrefix()
+ "messages (owner VARCHAR(255) NOT NULL, message TEXT(25) NOT NULL, time BIGINT(32) NOT NULL );";
if (plugin.getDatabase().getCore() instanceof MySQLCore) {
createTable = "CREATE TABLE " + QuickShop.instance.getDbPrefix()
+ "messages (owner VARCHAR(255) NOT NULL, message TEXT(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , time BIGINT(32) NOT NULL );";
}
return st.execute(createTable);
}