[Rt-commit] rt branch, 4.2/pg-drop-if-exists, created. rt-4.2.4-15-g0ac6485

Kevin Falcone falcone at bestpractical.com
Wed May 21 13:17:55 EDT 2014


The branch, 4.2/pg-drop-if-exists has been created
        at  0ac64855f479b4133f4fe838af6b8b2dec8f5d18 (commit)

- Log -----------------------------------------------------------------
commit 0ac64855f479b4133f4fe838af6b8b2dec8f5d18
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed May 21 13:14:22 2014 -0400

    Reorder sequence/table drop-if-exists order
    
    Without this, Postgres won't drop the sequence because the table still
    refers to it.  Simple fix is to drop the table if it exists and *then*
    try dropping the sequence.  Our other DROP IF EXISTS code touches serial
    tables, which handle the sequence dropping for us.

diff --git a/etc/upgrade/4.1.1/schema.Pg b/etc/upgrade/4.1.1/schema.Pg
index bb09c73..f6949ab 100644
--- a/etc/upgrade/4.1.1/schema.Pg
+++ b/etc/upgrade/4.1.1/schema.Pg
@@ -1,7 +1,7 @@
+DROP TABLE IF EXISTS ObjectScrips;
 DROP SEQUENCE IF EXISTS objectscrips_id_seq;
-CREATE SEQUENCE objectscrips_id_seq;
 
-DROP TABLE IF EXISTS ObjectScrips;
+CREATE SEQUENCE objectscrips_id_seq;
 CREATE TABLE ObjectScrips (
   id INTEGER DEFAULT nextval('objectscrips_id_seq'),
   Scrip integer NOT NULL,

-----------------------------------------------------------------------


More information about the rt-commit mailing list