public void bumpTo(SVNWCDb db, SVNSqlJetDb sDb, File wcRootAbsPath) throws SVNException { /*-- STMT_UPGRADE_TO_25 //DROP VIEW IF EXISTS NODES_CURRENT; CREATE VIEW NODES_CURRENT AS SELECT * FROM nodes JOIN (SELECT wc_id, local_relpath, MAX(op_depth) AS op_depth FROM nodes GROUP BY wc_id, local_relpath) AS filter ON nodes.wc_id = filter.wc_id AND nodes.local_relpath = filter.local_relpath AND nodes.op_depth = filter.op_depth; */ try { sDb.getDb().createView( "CREATE VIEW NODES_CURRENT AS " + "SELECT * FROM nodes JOIN (SELECT wc_id, local_relpath, MAX(op_depth) AS op_depth FROM nodes GROUP BY wc_id, local_relpath) AS filter " + "ON nodes.wc_id = filter.wc_id AND nodes.local_relpath = filter.local_relpath AND nodes.op_depth = filter.op_depth;"); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); } setVersion(sDb, (int)25); } }
public void bumpTo(SVNWCDb db, SVNSqlJetDb sDb, File wcRootAbsPath) throws SVNException { /*-- STMT_UPGRADE_TO_26 * DROP VIEW IF EXISTS NODES_BASE; * CREATE VIEW NODES_BASE AS * SELECT * FROM nodes * WHERE op_depth = 0; */ try { if (sDb.getDb().getSchema().getViewNames().contains("NODES_BASE")) { sDb.getDb().dropView("NODES_BASE"); } sDb.getDb().createView("CREATE VIEW NODES_BASE AS SELECT * FROM nodes WHERE op_depth = 0;"); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); } setVersion(sDb, (int)26); } }
db.createView(stmt.getSql());