diff --git a/build.xml b/build.xml index 5e18e1338..149252d03 100644 --- a/build.xml +++ b/build.xml @@ -205,7 +205,6 @@ - diff --git a/src/java/com/threerings/admin/server/DatabaseConfigRegistry.java b/src/java/com/threerings/admin/server/DatabaseConfigRegistry.java index 3eb04345c..34631744a 100644 --- a/src/java/com/threerings/admin/server/DatabaseConfigRegistry.java +++ b/src/java/com/threerings/admin/server/DatabaseConfigRegistry.java @@ -56,7 +56,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry // documentation inherited protected ObjectRecord createObjectRecord (String path, DObject object) { - return null; + return new DatabaseObjectRecord(path, object); } protected class DatabaseObjectRecord extends ObjectRecord diff --git a/src/java/com/threerings/admin/server/persist/ConfigRepository.java b/src/java/com/threerings/admin/server/persist/ConfigRepository.java index 4a6064d67..f2e6289e1 100644 --- a/src/java/com/threerings/admin/server/persist/ConfigRepository.java +++ b/src/java/com/threerings/admin/server/persist/ConfigRepository.java @@ -90,17 +90,20 @@ public class ConfigRepository extends JORARepository protected void migrateSchema (Connection conn, DatabaseLiaison liaison) throws SQLException, PersistenceException { - if (!JDBCUtil.tableExists(conn, "CONFIG")) { - Log.info("Creating admin.config schema..."); - JDBCUtil.loadSchema(conn, "admin/config.sql"); - } + JDBCUtil.createTableIfMissing(conn, "CONFIG", new String[] { + "OBJECT VARCHAR(255) NOT NULL", + "FIELD VARCHAR(255) NOT NULL", + "VALUE TEXT NOT NULL", + "PRIMARY KEY (OBJECT, FIELD)", + }); } // documentation inherited protected void createTables (Session session) { _ctable = new Table( - ConfigDatum.class.getName(), "CONFIG", session, "OBJECT", true); + ConfigDatum.class.getName(), "CONFIG", session, + new String[] { "OBJECT", "FIELD" }, true); } protected Table _ctable; diff --git a/src/sql/admin/config.sql b/src/sql/admin/config.sql deleted file mode 100644 index 4334dbb6b..000000000 --- a/src/sql/admin/config.sql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * $Id$ - * - * Schema for the Admin services configuration table. - */ - -drop table if exists CONFIG; - -/** - * Contains all registered configuration data. - */ -CREATE TABLE CONFIG -( - /** The configuration object with which this datum is associated. */ - OBJECT VARCHAR(255) NOT NULL, - - /** The configuration object field name. */ - FIELD VARCHAR(255) NOT NULL, - - /** The value of the object field. */ - VALUE TEXT NOT NULL, - - /** Defines our table keys. */ - PRIMARY KEY (OBJECT, FIELD) -);