Auto-create the sites and domains tables.

This commit is contained in:
Michael Bayne
2025-01-20 22:10:50 -08:00
parent f18af0cfd0
commit d91abf6649
@@ -187,12 +187,20 @@ public class JDBCTableSiteIdentifier implements SiteIdentifier
throws PersistenceException throws PersistenceException
{ {
// we are the operation! // we are the operation!
execute(this); executeUpdate(this);
} }
public Object invoke (Connection conn, DatabaseLiaison liaison) public Object invoke (Connection conn, DatabaseLiaison liaison)
throws PersistenceException, SQLException throws PersistenceException, SQLException
{ {
JDBCUtil.createTableIfMissing(conn, "sites", new String[] {
"siteId INTEGER UNSIGNED NOT NULL",
"siteString VARCHAR(255) NOT NULL",
}, "");
JDBCUtil.createTableIfMissing(conn, "domains", new String[] {
"domain VARCHAR(255) NOT NULL",
"siteId INTEGER UNSIGNED NOT NULL",
}, "");
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
try { try {
// first load up the list of sites // first load up the list of sites