[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6659] trunk
- Subject: SF.net SVN: ledger-smb:[6659] trunk
- From: ..hidden..
- Date: Mon, 27 Jan 2014 03:27:11 +0000
Revision: 6659
http://sourceforge.net/p/ledger-smb/code/6659
Author: einhverfr
Date: 2014-01-27 03:27:11 +0000 (Mon, 27 Jan 2014)
Log Message:
-----------
Documenting non-standard schema installations, and ensuring that upgrading is now schema agnostic
Modified Paths:
--------------
trunk/LedgerSMB/Scripts/setup.pm
trunk/UPGRADE
trunk/sql/upgrade/1.4-1.2.sql
Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm 2014-01-27 03:11:38 UTC (rev 6658)
+++ trunk/LedgerSMB/Scripts/setup.pm 2014-01-27 03:27:11 UTC (rev 6659)
@@ -886,8 +886,8 @@
my $temp = $database->loader_log_filename();
my $rc;
- $dbh->do('CREATE SCHEMA PUBLIC')
- or die "Failed to create schema PUBLIC (" . $dbh->errstr . ")";
+ $dbh->do("CREATE SCHEMA $LedgerSMB::Sysconfig::dbnamespace")
+ or die "Failed to create schema $LedgerSMB::Sysconfig::dbnamespace (" . $dbh->errstr . ")";
$dbh->commit;
$dbh->begin_work;
@@ -959,7 +959,7 @@
my $dbinfo = $database->get_info();
my $v = $dbinfo->{version};
$v =~ s/\.//;
- $dbh->do("ALTER SCHEMA public RENAME TO lsmb$v");
+ $dbh->do("ALTER SCHEMA $LedgerSMB::Sysconfig::db_namespace RENAME TO lsmb$v");
process_and_run_upgrade_script($request, $database, "lsmb$v",
"$dbinfo->{version}-1.4");
Modified: trunk/UPGRADE
===================================================================
--- trunk/UPGRADE 2014-01-27 03:11:38 UTC (rev 6658)
+++ trunk/UPGRADE 2014-01-27 03:27:11 UTC (rev 6659)
@@ -65,3 +65,31 @@
passwords after logging into LedgerSMB.
* log into the application and create additional users under System/User
Management
+
+ROLLING BACK AN UPGRADE
+=========================
+
+LedgerSMB upgrades are non-destructive and work by moving data to the side,
+adding mapping data, and then populating a new LedgerSMB schema. The data is retained in an old schema, with a naming convention like lsmbnn (for LedgerSMB) or slnn (for SQL-Ledger). The following schemas are used currently:
+
+lsmb13: LedgerSMB 1.3
+lsmb12: LedgerSMB 1.2
+sl28: SQL-Ledger 2.8
+
+We include downgrade scripts for previous LSMB versions. This works by removing
+the mapping the data and restoring the old schema. Changes made in the process
+of preparing for upgrades (the test screens for unique identifiers etc) are
+preserved but nothing else is.
+
+The downgrade scripts assume that LedgerSMB is installed in the public schema.
+If this is not the case, then the scripts will have to be edited before running.
+
+UPGRADING INTO A NON-STANDARD SCHEMA
+====================================
+
+The installation and upgrade scripts are schema-agnostic. They install the
+components into the first available schema on the installing super-users
+search_path.
+
+This should be done for users of the software too (using alter database or alter
+user), and it must also be configured in the ledgersmb.conf.
Modified: trunk/sql/upgrade/1.4-1.2.sql
===================================================================
--- trunk/sql/upgrade/1.4-1.2.sql 2014-01-27 03:11:38 UTC (rev 6658)
+++ trunk/sql/upgrade/1.4-1.2.sql 2014-01-27 03:27:11 UTC (rev 6659)
@@ -1,6 +1,6 @@
BEGIN;
-ALTER SCHEMA public RENAME TO lsmb_13fail;
+ALTER SCHEMA public RENAME TO lsmb_14fail;
ALTER SCHEMA lsmb12 RENAME TO public;
COMMIT;
@@ -16,6 +16,6 @@
ALTER TABLE employee DROP COLUMN entity_id;
COMMIT;
-\echo Note that this creates a lsmb_13fail schema with the failed migration data.
+\echo Note that this creates a lsmb_14fail schema with the failed migration data.
\echo You must drop that schema when you are done troubleshooting why this failed.
\echo Otherwise you will be unable to roll back after then next upgrade attempt.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits