blob: fcbf031f633a308f37fb43efc8eccdd70425def6 (
plain)
- #
- #
- #
- # 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
|