public Object run(SqlJetDb db) throws SqlJetException { db.createTable("create table revprop (revision integer UNIQUE not null, " + "properties BLOB not null);"); db.createIndex("create index i_revision on revprop (revision);"); db.getOptions().setUserVersion(1); return null; } });
private void createStructure(SqlJetDb db) throws SqlJetException { db.beginTransaction(SqlJetTransactionMode.WRITE); try { db.createTable("CREATE TABLE states (full_name TEXT NOT NULL PRIMARY KEY, version TEXT NULL)"); db.createIndex("CREATE INDEX full_name_index ON states(full_name)"); } finally { db.commit(); } }
@Override public void execute(SqlJetDb database) throws SqlJetException { ISqlJetSchema schema = database.getSchema(); if (schema.getTable(INVOCATION_TABLE) == null) { database.createTable(CREATE_INVOCATION_SQL); } if (schema.getTable(INVOKER_TABLE) == null) { database.createTable(CREATE_INVOKER_SQL); database.createIndex(CREATE_INVOKER_INDEX); } } };
handleDropTable(); } else if ("create_index".equalsIgnoreCase(stmtName)) { db.createIndex(sql); } else if ("drop_index".equalsIgnoreCase(stmtName)) { handleDropIndex();
private void ensureNodesMovedToIndex(SVNSqlJetDb sDb) throws SVNException { try { sDb.beginTransaction(SqlJetTransactionMode.WRITE); if (sDb.getDb().getSchema().getIndex("I_NODES_MOVED") == null) { sDb.getDb().createIndex("CREATE UNIQUE INDEX I_NODES_MOVED ON NODES (wc_id, moved_to, op_depth);"); } sDb.commit(); } catch (SqlJetException e) { sDb.rollback(); SVNSqlJetDb.createSqlJetError(e); } }
public void bumpTo(SVNWCDb db, SVNSqlJetDb sDb, File wcRootAbsPath) throws SVNException { try { if (sDb.getDb().getSchema().getTable("NODES").getColumn("inherited_props") == null) { sDb.getDb().createIndex("CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED ON NODES (wc_id, moved_to, op_depth);"); sDb.getDb().createIndex("CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum);");
" PRIMARY KEY (wc_id, local_relpath) " + "); "); sDb.getDb().createIndex("CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath);"); sDb.getDb().createIndex("CREATE UNIQUE INDEX I_EXTERNALS_DEFINED ON EXTERNALS (wc_id, def_local_relpath, local_relpath);"); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e);
db.createIndex(stmt.getSql()); db.createIndex(stmt.getSql());
sDb.getDb().createIndex("CREATE UNIQUE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath, local_relpath, op_depth);"); sDb.getDb().dropIndex("I_ACTUAL_PARENT"); sDb.getDb().createIndex("CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath, local_relpath);");
+ " changed_revision INTEGER, changed_date INTEGER, changed_author TEXT, translated_size INTEGER, last_mod_time INTEGER, " + " dav_cache BLOB, file_external TEXT, PRIMARY KEY (wc_id, local_relpath, op_depth) ); "); sDb.getDb().createIndex("CREATE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath, op_depth); ");