[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5078] branches/1.3



Revision: 5078
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5078&view=rev
Author:   einhverfr
Date:     2012-08-02 02:19:37 +0000 (Thu, 02 Aug 2012)
Log Message:
-----------
Fixing make/model primary key so multiple make/models can be added

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/sql/Pg-database.sql
    branches/1.3/sql/modules/Fixes.sql

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-08-01 09:52:12 UTC (rev 5077)
+++ branches/1.3/Changelog	2012-08-02 02:19:37 UTC (rev 5078)
@@ -2,6 +2,9 @@
 Initial Release:  Monday, Oct 12 2011
 Supported Presently
 
+Changelog for 1.3.22
+* Fixed error when trying to save multiple make/models for a part (Chris T)
+
 Changelog for 1.3.21
 * Added a default numberformat in Form.pm (Chris T)
 * Added a container div for theming saved and/or posted docs (Chris T)

Modified: branches/1.3/sql/Pg-database.sql
===================================================================
--- branches/1.3/sql/Pg-database.sql	2012-08-01 09:52:12 UTC (rev 5077)
+++ branches/1.3/sql/Pg-database.sql	2012-08-02 02:19:37 UTC (rev 5078)
@@ -966,9 +966,10 @@
 
 --
 CREATE TABLE makemodel (
-  parts_id int PRIMARY KEY,
+  parts_id int,
   make text,
-  model text
+  model text,
+  PRIMARY KEY (parts_id, make, model)
 );
 
 COMMENT ON TABLE makemodel IS

Modified: branches/1.3/sql/modules/Fixes.sql
===================================================================
--- branches/1.3/sql/modules/Fixes.sql	2012-08-01 09:52:12 UTC (rev 5077)
+++ branches/1.3/sql/modules/Fixes.sql	2012-08-02 02:19:37 UTC (rev 5078)
@@ -461,3 +461,9 @@
  where node_id in (select node_id from menu_attribute where attribute = 'menu');
 
 COMMIT;
+
+BEGIN;
+-- fix primary key for make/model
+ALTER TABLE makemodel DROP CONSTRAINT makemodel_pkey;
+ALTER TABLE makemodel ADD PRIMARY KEY(parts_id, make, model);
+COMMIT;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.