Define the schema in code, fixed up some bugs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3871 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -205,7 +205,6 @@
|
|||||||
<fileset dir="${classes.dir}" includes="com/threerings/presents/**"/>
|
<fileset dir="${classes.dir}" includes="com/threerings/presents/**"/>
|
||||||
<fileset dir="${classes.dir}" includes="com/threerings/crowd/**"/>
|
<fileset dir="${classes.dir}" includes="com/threerings/crowd/**"/>
|
||||||
<fileset dir="${classes.dir}" includes="com/threerings/admin/**"/>
|
<fileset dir="${classes.dir}" includes="com/threerings/admin/**"/>
|
||||||
<fileset dir="src/sql" includes="admin/*.sql"/>
|
|
||||||
<fileset dir="${classes.dir}" includes="rsrc/config/presents/**"/>
|
<fileset dir="${classes.dir}" includes="rsrc/config/presents/**"/>
|
||||||
<fileset dir="${classes.dir}" includes="rsrc/config/crowd/**"/>
|
<fileset dir="${classes.dir}" includes="rsrc/config/crowd/**"/>
|
||||||
</jar>
|
</jar>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
|
|||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected ObjectRecord createObjectRecord (String path, DObject object)
|
protected ObjectRecord createObjectRecord (String path, DObject object)
|
||||||
{
|
{
|
||||||
return null;
|
return new DatabaseObjectRecord(path, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class DatabaseObjectRecord extends ObjectRecord
|
protected class DatabaseObjectRecord extends ObjectRecord
|
||||||
|
|||||||
@@ -90,17 +90,20 @@ public class ConfigRepository extends JORARepository
|
|||||||
protected void migrateSchema (Connection conn, DatabaseLiaison liaison)
|
protected void migrateSchema (Connection conn, DatabaseLiaison liaison)
|
||||||
throws SQLException, PersistenceException
|
throws SQLException, PersistenceException
|
||||||
{
|
{
|
||||||
if (!JDBCUtil.tableExists(conn, "CONFIG")) {
|
JDBCUtil.createTableIfMissing(conn, "CONFIG", new String[] {
|
||||||
Log.info("Creating admin.config schema...");
|
"OBJECT VARCHAR(255) NOT NULL",
|
||||||
JDBCUtil.loadSchema(conn, "admin/config.sql");
|
"FIELD VARCHAR(255) NOT NULL",
|
||||||
}
|
"VALUE TEXT NOT NULL",
|
||||||
|
"PRIMARY KEY (OBJECT, FIELD)",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void createTables (Session session)
|
protected void createTables (Session session)
|
||||||
{
|
{
|
||||||
_ctable = new Table(
|
_ctable = new Table(
|
||||||
ConfigDatum.class.getName(), "CONFIG", session, "OBJECT", true);
|
ConfigDatum.class.getName(), "CONFIG", session,
|
||||||
|
new String[] { "OBJECT", "FIELD" }, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Table _ctable;
|
protected Table _ctable;
|
||||||
|
|||||||
@@ -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)
|
|
||||||
);
|
|
||||||
Reference in New Issue
Block a user