Rename "rhizome list" output column headers

_inserttime -> .inserttime
_selfsigned -> .selfsigned
This commit is contained in:
Andrew Bettison 2012-06-13 18:11:14 +09:30
parent eeb8a22495
commit 8fca6b5c5e
2 changed files with 7 additions and 6 deletions

View File

@ -159,9 +159,10 @@ int rhizome_opendb()
}
// No easy way to tell if these columns already exist, should probably create some kind of schema
// version table. Running these a second time will fail.
sqlite_exec_void_loglevel(LOG_LEVEL_INFO, "ALTER TABLE MANIFESTS ADD COLUMN filesize text;");
sqlite_exec_void_loglevel(LOG_LEVEL_INFO, "ALTER TABLE MANIFESTS ADD COLUMN filehash text;");
sqlite_exec_void_loglevel(LOG_LEVEL_INFO, "ALTER TABLE FILES ADD inserttime integer;");
int loglevel = (debug & DEBUG_RHIZOME) ? LOG_LEVEL_DEBUG : LOG_LEVEL_SILENT;
sqlite_exec_void_loglevel(loglevel, "ALTER TABLE MANIFESTS ADD COLUMN filesize text;");
sqlite_exec_void_loglevel(loglevel, "ALTER TABLE MANIFESTS ADD COLUMN filehash text;");
sqlite_exec_void_loglevel(loglevel, "ALTER TABLE FILES ADD inserttime integer;");
/* Upgrade schema */
if ( sqlite_exec_void("CREATE INDEX IF NOT EXISTS IDX_MANIFESTS_HASH ON MANIFESTS(filehash);") == -1
|| sqlite_exec_void("DELETE FROM MANIFESTS WHERE filehash IS NULL;") == -1
@ -676,8 +677,8 @@ int rhizome_list_manifests(const char *service, const char *sender_sid, const ch
cli_puts("id"); cli_delim(":");
cli_puts("version"); cli_delim(":");
cli_puts("date"); cli_delim(":");
cli_puts("_inserttime"); cli_delim(":");
cli_puts("_selfsigned"); cli_delim(":");
cli_puts(".inserttime"); cli_delim(":");
cli_puts(".selfsigned"); cli_delim(":");
cli_puts("filesize"); cli_delim(":");
cli_puts("filehash"); cli_delim(":");
cli_puts("sender"); cli_delim(":");

View File

@ -89,7 +89,7 @@ assert_manifest_complete() {
assert_rhizome_list() {
assertStdoutLineCount '==' $(($# + 2))
assertStdoutIs --stderr --line=1 -e '11\n'
assertStdoutIs --stderr --line=2 -e 'service:id:version:date:_inserttime:_selfsigned:filesize:filehash:sender:recipient:name\n'
assertStdoutIs --stderr --line=2 -e 'service:id:version:date:.inserttime:.selfsigned:filesize:filehash:sender:recipient:name\n'
local filename
for filename; do
re__selfsigned=1