mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix for Postgres 7.0 -- insert verion values after table is created.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5439 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
dacb6a0671
commit
40792644bf
@ -12,3 +12,4 @@ kvp-autogen.c
|
|||||||
table-audit.c
|
table-audit.c
|
||||||
table-create.c
|
table-create.c
|
||||||
table-drop.c
|
table-drop.c
|
||||||
|
table-version.c
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
SUBDIRS=test
|
SUBDIRS = . test
|
||||||
|
|
||||||
pkglib_LTLIBRARIES = libgncmod-backend-postgres.la
|
pkglib_LTLIBRARIES = libgncmod-backend-postgres.la
|
||||||
libgncmod_backend_postgres_la_LDFLAGS =-module -lpq -L../../engine -L../../engine/.libs -lgncmod-engine ${GLIB_LIBS}
|
libgncmod_backend_postgres_la_LDFLAGS =-module -lpq -L../../engine -L../../engine/.libs -lgncmod-engine ${GLIB_LIBS}
|
||||||
@ -45,6 +45,7 @@ EXTRA_DIST = \
|
|||||||
table-audit.sql \
|
table-audit.sql \
|
||||||
table-create.sql \
|
table-create.sql \
|
||||||
table-drop.sql \
|
table-drop.sql \
|
||||||
|
table-version.sql \
|
||||||
demo.c
|
demo.c
|
||||||
|
|
||||||
INCLUDES = -I.. -I../.. -I../../engine -I../../gnc-module
|
INCLUDES = -I.. -I../.. -I../../engine -I../../gnc-module
|
||||||
@ -53,8 +54,8 @@ CFLAGS = @CFLAGS@ ${GLIB_CFLAGS}
|
|||||||
# Some of the required C files are built with the m4 pre-processor
|
# Some of the required C files are built with the m4 pre-processor
|
||||||
# As a result, we need to manually specify dependencies, clean targets.
|
# As a result, we need to manually specify dependencies, clean targets.
|
||||||
|
|
||||||
PostgresBackend.o: base-autogen.c table-audit.c table-create.c table-drop.c functions.c
|
PostgresBackend.o: base-autogen.c table-audit.c table-create.c table-version.c table-drop.c functions.c
|
||||||
PostgresBackend.lo: base-autogen.c table-audit.c table-create.c table-drop.c functions.c
|
PostgresBackend.lo: base-autogen.c table-audit.c table-create.c table-version.c table-drop.c functions.c
|
||||||
|
|
||||||
checkpoint.o: check-autogen.c
|
checkpoint.o: check-autogen.c
|
||||||
checkpoint.lo: check-autogen.c
|
checkpoint.lo: check-autogen.c
|
||||||
@ -95,8 +96,13 @@ table-drop.c: table-drop.sql
|
|||||||
cat table-drop.sql >> table-drop.c
|
cat table-drop.sql >> table-drop.c
|
||||||
echo \" >> table-drop.c
|
echo \" >> table-drop.c
|
||||||
|
|
||||||
|
table-version.c: table-version.sql
|
||||||
|
echo \" > table-version.c
|
||||||
|
echo "-- DO NOT EDIT THIS FILE. IT IS AUTOGENERATED." >> table-version.c
|
||||||
|
cat table-version.sql >> table-version.c
|
||||||
|
echo \" >> table-version.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f base-autogen.c check-autogen.c kvp-autogen.c
|
-rm -f base-autogen.c check-autogen.c kvp-autogen.c
|
||||||
-rm -f table-drop.c table-create.c functions.c
|
-rm -f table-drop.c table-create.c table-version.c functions.c
|
||||||
|
|
||||||
|
@ -215,6 +215,10 @@ static const char *table_create_str =
|
|||||||
#include "table-create.c"
|
#include "table-create.c"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
static const char *table_version_str =
|
||||||
|
#include "table-version.c"
|
||||||
|
;
|
||||||
|
|
||||||
static const char *sql_functions_str =
|
static const char *sql_functions_str =
|
||||||
#include "functions.c"
|
#include "functions.c"
|
||||||
;
|
;
|
||||||
@ -1647,6 +1651,8 @@ pgend_session_begin (Backend *backend, GNCBook *book, const char * sessionid,
|
|||||||
*/
|
*/
|
||||||
SEND_QUERY (be,table_create_str, );
|
SEND_QUERY (be,table_create_str, );
|
||||||
FINISH_QUERY(be->connection);
|
FINISH_QUERY(be->connection);
|
||||||
|
SEND_QUERY (be,table_version_str, );
|
||||||
|
FINISH_QUERY(be->connection);
|
||||||
SEND_QUERY (be,table_audit_str, );
|
SEND_QUERY (be,table_audit_str, );
|
||||||
FINISH_QUERY(be->connection);
|
FINISH_QUERY(be->connection);
|
||||||
SEND_QUERY (be,sql_functions_str, );
|
SEND_QUERY (be,sql_functions_str, );
|
||||||
|
@ -29,8 +29,6 @@ CREATE TABLE gncVersion (
|
|||||||
name TEXT UNIQUE NOT NULL CHECK (name <> ''),
|
name TEXT UNIQUE NOT NULL CHECK (name <> ''),
|
||||||
date DATETIME DEFAULT 'NOW'
|
date DATETIME DEFAULT 'NOW'
|
||||||
);
|
);
|
||||||
INSERT INTO gncVersion (major,minor,rev,name) VALUES (1,0,0,'Version Table');
|
|
||||||
INSERT INTO gncVersion (major,minor,rev,name) VALUES (1,1,1,'iGUID in Main Tables');
|
|
||||||
|
|
||||||
-- Commodity structure
|
-- Commodity structure
|
||||||
-- Store currency, security types. Namespace includes
|
-- Store currency, security types. Namespace includes
|
||||||
|
16
src/backend/postgres/table-version.sql
Normal file
16
src/backend/postgres/table-version.sql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
--
|
||||||
|
-- FILE:
|
||||||
|
-- table-version.sql
|
||||||
|
--
|
||||||
|
-- FUNCTION:
|
||||||
|
-- Insert the latest version information into the gncVersion table.
|
||||||
|
--
|
||||||
|
-- Inserting in the same query as creating the table does not
|
||||||
|
-- work under Postgres 7.0
|
||||||
|
--
|
||||||
|
-- HISTORY:
|
||||||
|
-- Copyright (C) 2001 Linux Developers Group
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO gncVersion (major,minor,rev,name) VALUES (1,0,0,'Version Table');
|
||||||
|
INSERT INTO gncVersion (major,minor,rev,name) VALUES (1,1,1,'iGUID in Main Tables');
|
@ -17,6 +17,7 @@ LDADD = -L${top_srcdir}/src/gnc-module -L${top_srcdir}/src/gnc-module/.libs \
|
|||||||
${top_srcdir}/src/gnc-module/libgncmodule.la \
|
${top_srcdir}/src/gnc-module/libgncmodule.la \
|
||||||
${top_srcdir}/src/engine/libgncmod-engine.la \
|
${top_srcdir}/src/engine/libgncmod-engine.la \
|
||||||
${top_srcdir}/src/engine/test-core/libgncmod-test-engine.la \
|
${top_srcdir}/src/engine/test-core/libgncmod-test-engine.la \
|
||||||
|
${top_srcdir}/src/backend/postgres/libgncmod-backend-postgres.la \
|
||||||
-lltdl
|
-lltdl
|
||||||
|
|
||||||
CFLAGS = ${GLIB_CFLAGS}
|
CFLAGS = ${GLIB_CFLAGS}
|
||||||
|
Loading…
Reference in New Issue
Block a user