summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-02-06 05:21:25 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-02-06 05:21:25 +0000
commit336788cfcd51ebd41f1ca41119385d0c14e988e8 (patch)
tree407561fc5db9272b78901cdca1d84298a5ab7fea
parentdf8840a26ab1ad9491ecb49e35eb3beceff97cd9 (diff)
Accepting LBMoore's upgrade fixes
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@794 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--CONTRIBUTORS3
-rw-r--r--sl2ls.sh63
2 files changed, 65 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 276006cc..6925be20 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -44,7 +44,8 @@ Tony Fraser <tony @ sybaspace.com> provided some database fixes.
John Hasler <john @ dhh.gt.org> has provided some double-entry information for
the manual and miscellaneous documentation corrections.
-Louis B. Moore has provided the documentation on the command-line API.
+Louis B. Moore has provided the documentation on the command-line API and helped
+with upgrade scripts.
Original Authors of SQL-Ledger:
===================================
diff --git a/sl2ls.sh b/sl2ls.sh
new file mode 100644
index 00000000..fcbf031f
--- /dev/null
+++ b/sl2ls.sh
@@ -0,0 +1,63 @@
+#
+#
+#
+# SQL-Ledger Dataset name and Dataset Owner
+#
+SLDB=sqlledger
+SLOWN=SQL-Ledger_Owner
+
+#
+# Ledger-SMB Dataset name and Dataset Owner
+#
+LSDB=lsmbprod
+LSOWN=ledgersmb
+
+
+psql template1 -c "DROP DATABASE ${LSDB};"
+
+pg_dump ${SLDB} > sl2ls.sql
+
+sed -i -e "s/${SLOWN}/${LSOWN}/" sl2ls.sql
+sed -i -e "s/SQL_ASCII/LATIN1/" sl2ls.sql
+
+createdb -O ${LSOWN} ${LSDB}
+
+psql ${LSDB} ${LSOWN} -c "\i /usr/local/ledger-smb/sql/Pg-central.sql"
+
+psql template1 -c "ALTER USER ${LSOWN} WITH superuser;"
+
+psql ${LSDB} ${LSOWN} -c "\i sl2ls.sql"
+
+psql template1 -c "ALTER USER ${LSOWN} WITH nosuperuser;"
+
+cd /usr/local/ledger-smb/sql/legacy/
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.12-2.6.17.sql"
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.17-2.6.18.sql"
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.18-2.6.19.sql"
+
+echo '###############################################################'
+echo
+echo 'Should error with--> ERROR: column "version" does not exist'
+echo
+echo '###############################################################'
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "update users_conf set password = md5('apasswrd');"
+
+cd /usr/local/ledger-smb
+
+./import_members.pl users/members
+
+psql ${LSDB} ${LSOWN} -c "SELECT * FROM users;"
+
+exit