4 # Test the database upgrades in gcm_daemon.
5 # Create an old, version 1, database and run gcm_daemon to perform
6 # an upgrade to the latest version.
7 # Then, create a latest-version database and compare dumps of these
8 # database. They should be essentially the same.
12 if psql gnucomo_test -f test/create_v1.sql -q >/dev/null
14 src/gcm_daemon/gcm_daemon.php -c gnucomo_test
15 pg_dump gnucomo_test |grep -v '^--' | sort >test/dump.upgraded.sql
16 psql gnucomo_test -f src/database/destroy.sql -q
17 psql gnucomo_test -f src/database/create.sql -q >/dev/null
18 pg_dump gnucomo_test |grep -v '^--' | sort >test/dump.latest.sql
19 psql gnucomo_test -f src/database/destroy.sql -q
21 # Expect 28 lines of diff output (character varying vs. text types)
22 diff test/dump.latest.sql test/dump.upgraded.sql
26 echo Can not create test database