public void createLogTable(final String tableName, final String entryTypeName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " %4$s_id VARCHAR(255) DEFAULT NULL,\n" + " log_payload %3$s,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType(), entryTypeName ), StringUtils.format("CREATE INDEX idx_%1$s_%2$s_id ON %1$s(%2$s_id)", tableName, entryTypeName) ) ); }
public void createLockTable(final String tableName, final String entryTypeName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " %4$s_id VARCHAR(255) DEFAULT NULL,\n" + " lock_payload %3$s,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType(), entryTypeName ), StringUtils.format("CREATE INDEX idx_%1$s_%2$s_id ON %1$s(%2$s_id)", tableName, entryTypeName) ) ); }
public void createSupervisorsTable(final String tableName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " spec_id VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " payload %3$s NOT NULL,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType() ), StringUtils.format("CREATE INDEX idx_%1$s_spec_id ON %1$s(spec_id)", tableName) ) ); }
private void createAuditTable(final String tableName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " audit_key VARCHAR(255) NOT NULL,\n" + " type VARCHAR(255) NOT NULL,\n" + " author VARCHAR(255) NOT NULL,\n" + " comment VARCHAR(2048) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " payload %3$s NOT NULL,\n" + " PRIMARY KEY(id)\n" + ")", tableName, getSerialType(), getPayloadType() ), StringUtils.format("CREATE INDEX idx_%1$s_key_time ON %1$s(audit_key, created_date)", tableName), StringUtils.format("CREATE INDEX idx_%1$s_type_time ON %1$s(type, created_date)", tableName), StringUtils.format("CREATE INDEX idx_%1$s_audit_time ON %1$s(created_date)", tableName) ) ); }
public void createLockTable(final String tableName, final String entryTypeName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " %4$s_id VARCHAR(255) DEFAULT NULL,\n" + " lock_payload %3$s,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType(), entryTypeName ), StringUtils.format("CREATE INDEX idx_%1$s_%2$s_id ON %1$s(%2$s_id)", tableName, entryTypeName) ) ); }
public void createLogTable(final String tableName, final String entryTypeName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " %4$s_id VARCHAR(255) DEFAULT NULL,\n" + " log_payload %3$s,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType(), entryTypeName ), StringUtils.format("CREATE INDEX idx_%1$s_%2$s_id ON %1$s(%2$s_id)", tableName, entryTypeName) ) ); }
public void createSupervisorsTable(final String tableName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " spec_id VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " payload %3$s NOT NULL,\n" + " PRIMARY KEY (id)\n" + ")", tableName, getSerialType(), getPayloadType() ), StringUtils.format("CREATE INDEX idx_%1$s_spec_id ON %1$s(spec_id)", tableName) ) ); }
private void createAuditTable(final String tableName) { createTable( tableName, ImmutableList.of( StringUtils.format( "CREATE TABLE %1$s (\n" + " id %2$s NOT NULL,\n" + " audit_key VARCHAR(255) NOT NULL,\n" + " type VARCHAR(255) NOT NULL,\n" + " author VARCHAR(255) NOT NULL,\n" + " comment VARCHAR(2048) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " payload %3$s NOT NULL,\n" + " PRIMARY KEY(id)\n" + ")", tableName, getSerialType(), getPayloadType() ), StringUtils.format("CREATE INDEX idx_%1$s_key_time ON %1$s(audit_key, created_date)", tableName), StringUtils.format("CREATE INDEX idx_%1$s_type_time ON %1$s(type, created_date)", tableName), StringUtils.format("CREATE INDEX idx_%1$s_audit_time ON %1$s(created_date)", tableName) ) ); }