
jbe@42: BEGIN;
jbe@42: 
jbe@42: CREATE OR REPLACE VIEW "liquid_feedback_version" AS
jbe@43:   SELECT * FROM (VALUES ('incomplete_update_from_beta25_to_beta26', NULL, NULL, NULL))
jbe@42:   AS "subquery"("string", "major", "minor", "revision");
jbe@42: 
jbe@42: ALTER TABLE "member" ADD COLUMN "last_login" TIMESTAMPTZ;
jbe@42: ALTER TABLE "member_history" ADD COLUMN "active" BOOLEAN;
jbe@42: 
jbe@42: UPDATE "member_history" SET "active" = TRUE;
jbe@42: INSERT INTO "member_history" ("member_id", "login", "active", "name")
jbe@42:   SELECT "id", "login", TRUE AS "active", "name"
jbe@42:   FROM "member" WHERE "active" = FALSE;
jbe@42: 
jbe@42: COMMIT;
jbe@42: 
jbe@42: -- Complete the update as follows:
jbe@42: -- =========================================
jbe@42: -- pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql
jbe@42: -- dropdb DATABASE_NAME
jbe@42: -- createdb DATABASE_NAME
jbe@42: -- psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME
jbe@42: -- psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME
jbe@42: -- rm tmp.sql
jbe@42: 




