more book-support fixes, additions

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6447 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2001-12-31 18:27:13 +00:00
parent 44d54c3637
commit ce95a89635
2 changed files with 13 additions and 4 deletions

View File

@ -17,6 +17,13 @@ define(`account', `gncAccount, Account, Account, a,
accountGUID, KEY, GUID *, xaccAccountGetGUID(ptr),
')
define(`book', `gncBook, Book, GNCBook, b,
book_open, , char, ptr->book_open,
version, , int32, ptr->version,
iguid, , int32, ptr->idata,
bookGUID, KEY, GUID *, gnc_book_get_guid(ptr),
')
define(`split', `gncEntry, Split, Split, e,
accountGUID, , GUID *, xaccAccountGetGUID(xaccSplitGetAccount(ptr)),
transGUID, , GUID *, xaccTransGetGUID(xaccSplitGetParent(ptr)),
@ -245,7 +252,7 @@ define(`store_one_only',
buf = sqlBuild_Query (be->builder);
SEND_QUERY (be,buf, );
/* complete/commit the transaction, check the status */
/* flush the buffers, check the status */
FINISH_QUERY(be->connection);
LEAVE (" ");
}
@ -430,7 +437,7 @@ define(`store_audit',
buf = sqlBuild_Query (be->builder);
SEND_QUERY (be,buf, );
/* complete/commit the transaction, check the status */
/* flush the buffers, check the status */
FINISH_QUERY(be->connection);
LEAVE (" ");
}

View File

@ -303,6 +303,7 @@ add_multiple_book_support (PGBackend *be)
p = "CREATE TABLE gncBook ( \n"
" bookGuid CHAR(32) PRIMARY KEY, \n"
" book_open CHAR DEFAULT 'n', \n"
" version INT4 NOT NULL, \n"
" iguid INT4 DEFAULT 0 \n"
");";
@ -311,6 +312,7 @@ add_multiple_book_support (PGBackend *be)
p = "CREATE TABLE gncBookTrail ( \n"
" bookGuid CHAR(32) NOT NULL, \n"
" book_open CHAR DEFAULT 'n', \n"
" version INT4 NOT NULL, \n"
" iguid INT4 DEFAULT 0 \n"
") INHERITS (gncAuditTrail); \n\n"
@ -338,10 +340,10 @@ add_multiple_book_support (PGBackend *be)
FINISH_QUERY(be->connection);
p = buff;
p = stpcpy (p, "INSERT INTO gncBook (bookGuid, version, iguid) "
p = stpcpy (p, "INSERT INTO gncBook (bookGuid, book_open, version, iguid) "
"VALUES ('");
p = guid_to_string_buff (gnc_book_get_guid (be->book), p);
p = stpcpy (p, "', 1, nextval('gnc_iguid_seq') );");
p = stpcpy (p, "', 'y', 1, nextval('gnc_iguid_seq') );");
SEND_QUERY (be,buff, );
FINISH_QUERY(be->connection);