Increase actions actor_name column length (#525)

This commit is contained in:
Luck 2017-10-30 20:03:03 +00:00
parent 230d9725e8
commit 0e581cbcf3
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
9 changed files with 15 additions and 8 deletions

View File

@ -195,6 +195,13 @@ public class SqlDao extends AbstractDao {
}
}
// migrations
try (Connection connection = provider.getConnection()) {
try (Statement s = connection.createStatement()) {
s.execute(prefix.apply("ALTER TABLE {prefix}actions MODIFY COLUMN actor_name VARCHAR(36)"));
}
}
setAcceptingLogins(true);
} catch (Exception e) {
e.printStackTrace();

View File

@ -35,7 +35,7 @@ import java.text.DecimalFormat;
import java.util.concurrent.locks.ReentrantLock;
abstract class FlatfileConnectionFactory extends AbstractConnectionFactory {
protected static final DecimalFormat DF = new DecimalFormat("#.00");
protected static final DecimalFormat DF = new DecimalFormat("#.##");
protected final File file;
private final ReentrantLock lock = new ReentrantLock();

View File

@ -46,7 +46,7 @@ public class H2ConnectionFactory extends FlatfileConnectionFactory {
File databaseFile = new File(super.file.getParent(), "luckperms-h2.mv.db");
if (databaseFile.exists()) {
double size = databaseFile.length() / 1048576;
double size = databaseFile.length() / 1048576D;
ret.put("File Size", DF.format(size) + "MB");
} else {
ret.put("File Size", "0MB");

View File

@ -46,7 +46,7 @@ public class SQLiteConnectionFactory extends FlatfileConnectionFactory {
File databaseFile = new File(super.file.getParent(), "luckperms-sqlite.db");
if (databaseFile.exists()) {
double size = databaseFile.length() / 1048576;
double size = databaseFile.length() / 1048576D;
ret.put("File Size", DF.format(size) + "MB");
} else {
ret.put("File Size", "0MB");

View File

@ -45,7 +45,7 @@ CREATE TABLE `{prefix}actions` (
`id` INT AUTO_INCREMENT NOT NULL,
`time` BIGINT NOT NULL,
`actor_uuid` VARCHAR(36) NOT NULL,
`actor_name` VARCHAR(16) NOT NULL,
`actor_name` VARCHAR(36) NOT NULL,
`type` CHAR(1) NOT NULL,
`acted_uuid` VARCHAR(36) NOT NULL,
`acted_name` VARCHAR(36) NOT NULL,

View File

@ -45,7 +45,7 @@ CREATE TABLE `{prefix}actions` (
`id` INT AUTO_INCREMENT NOT NULL,
`time` BIGINT NOT NULL,
`actor_uuid` VARCHAR(36) NOT NULL,
`actor_name` VARCHAR(16) NOT NULL,
`actor_name` VARCHAR(36) NOT NULL,
`type` CHAR(1) NOT NULL,
`acted_uuid` VARCHAR(36) NOT NULL,
`acted_name` VARCHAR(36) NOT NULL,

View File

@ -45,7 +45,7 @@ CREATE TABLE `{prefix}actions` (
`id` INT AUTO_INCREMENT NOT NULL,
`time` BIGINT NOT NULL,
`actor_uuid` VARCHAR(36) NOT NULL,
`actor_name` VARCHAR(16) NOT NULL,
`actor_name` VARCHAR(36) NOT NULL,
`type` CHAR(1) NOT NULL,
`acted_uuid` VARCHAR(36) NOT NULL,
`acted_name` VARCHAR(36) NOT NULL,

View File

@ -41,7 +41,7 @@ CREATE TABLE "{prefix}actions" (
"id" SERIAL PRIMARY KEY NOT NULL,
"time" BIGINT NOT NULL,
"actor_uuid" VARCHAR(36) NOT NULL,
"actor_name" VARCHAR(16) NOT NULL,
"actor_name" VARCHAR(36) NOT NULL,
"type" CHAR(1) NOT NULL,
"acted_uuid" VARCHAR(36) NOT NULL,
"acted_name" VARCHAR(36) NOT NULL,

View File

@ -43,7 +43,7 @@ CREATE TABLE `{prefix}actions` (
`id` INTEGER PRIMARY KEY NOT NULL,
`time` BIGINT NOT NULL,
`actor_uuid` VARCHAR(36) NOT NULL,
`actor_name` VARCHAR(16) NOT NULL,
`actor_name` VARCHAR(36) NOT NULL,
`type` CHAR(1) NOT NULL,
`acted_uuid` VARCHAR(36) NOT NULL,
`acted_name` VARCHAR(36) NOT NULL,