From 09cc25aff228bf2160abdc85b42e9af11fb15c26 Mon Sep 17 00:00:00 2001 From: baconwaifu <2634959+baconwaifu@users.noreply.github.com> Date: Mon, 27 Jan 2020 11:15:16 -0500 Subject: [PATCH] Fix Postgres column typing for standalone files --- .../org/dynmap/storage/postgresql/PostgreSQLMapStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/storage/postgresql/PostgreSQLMapStorage.java b/DynmapCore/src/main/java/org/dynmap/storage/postgresql/PostgreSQLMapStorage.java index 056bad11..c545b19d 100644 --- a/DynmapCore/src/main/java/org/dynmap/storage/postgresql/PostgreSQLMapStorage.java +++ b/DynmapCore/src/main/java/org/dynmap/storage/postgresql/PostgreSQLMapStorage.java @@ -456,7 +456,7 @@ public class PostgreSQLMapStorage extends MapStorage { doUpdate(c, "CREATE TABLE " + tableFaces + " (PlayerName VARCHAR(64) NOT NULL, TypeID INT NOT NULL, Image BYTEA, PRIMARY KEY(PlayerName, TypeID))"); doUpdate(c, "CREATE TABLE " + tableMarkerIcons + " (IconName VARCHAR(128) PRIMARY KEY NOT NULL, Image BYTEA)"); doUpdate(c, "CREATE TABLE " + tableMarkerFiles + " (FileName VARCHAR(128) PRIMARY KEY NOT NULL, Content BYTEA)"); - doUpdate(c, "CREATE TABLE " + tableStandaloneFiles + " (FileName VARCHAR(128) NOT NULL, ServerID BIGINT NOT NULL DEFAULT 0, Content TEXT, PRIMARY KEY (FileName, ServerID))"); + doUpdate(c, "CREATE TABLE " + tableStandaloneFiles + " (FileName VARCHAR(128) NOT NULL, ServerID BIGINT NOT NULL DEFAULT 0, Content BYTEA, PRIMARY KEY (FileName, ServerID))"); doUpdate(c, "CREATE TABLE " + tableSchemaVersion + " (level INT PRIMARY KEY NOT NULL)"); doUpdate(c, "INSERT INTO " + tableSchemaVersion + " (level) VALUES (3)"); } catch (SQLException x) { @@ -488,7 +488,7 @@ public class PostgreSQLMapStorage extends MapStorage { c = getConnection(); doUpdate(c, "DELETE FROM " + tableStandaloneFiles + ";"); doUpdate(c, "ALTER TABLE " + tableStandaloneFiles + " DROP COLUMN Content;"); - doUpdate(c, "ALTER TABLE " + tableStandaloneFiles + " ADD COLUMN Content TEXT;"); + doUpdate(c, "ALTER TABLE " + tableStandaloneFiles + " ADD COLUMN Content BYTEA;"); doUpdate(c, "UPDATE " + tableSchemaVersion + " SET level=3 WHERE level = 2;"); } catch (SQLException x) { Log.severe("Error creating tables - " + x.getMessage());