Commits

Tuukka Norri committed 6df4dff

Bug fixes
- Fixed a bug in baseten.disable SQL function. The bug caused the function search baseten tables from the search path instead of the baseten schema. (Fortunately they are named in a way that rarely causes collisions.)
- Some old SQL function names had been left to BaseTen Assistant. Renamed them.

Comments (0)

Files changed (2)

BaseTenAssistant/Sources/BXAController.m

 	if (status)
 	{
 		PGTSResultSet* res = nil;
-		res = [connection executeQuery: @"INSERT INTO baseten.viewprimarykey SELECT * FROM baseten_viewprimarykey"];
+		res = [connection executeQuery: @"INSERT INTO baseten.view_pkey SELECT * FROM baseten_view_pkey"];
 		if (! [res querySucceeded])
 			[NSApp presentError: [res error]];
 		else
 		{
-			res = [connection executeQuery: @"SELECT baseten.prepareformodificationobserving (oid) FROM baseten_enabledoids"];
+			res = [connection executeQuery: @"SELECT baseten.enable (oid) FROM baseten_enabled_oids"];
 			if (! [res querySucceeded])
 				[NSApp presentError: [res error]];
 		}
 	}
 	
 	//Clean up.
-	[connection executeQuery: @"DROP TABLE baseten_viewprimarykey"];
-	[connection executeQuery: @"DROP TABLE baseten_enabledoids"];
+	[connection executeQuery: @"DROP TABLE baseten_view_pkey"];
+	[connection executeQuery: @"DROP TABLE baseten_enabled_oids"];
 }
 
 - (void) upgradeBaseTenSchema
 {
 	PGTSConnection* connection = [[(BXPGInterface *) [mContext databaseInterface] transactionHandler] connection];
-	[connection executeQuery: @"CREATE TEMPORARY TABLE baseten_viewprimarykey AS SELECT * FROM baseten.viewprimarykey"];
+	[connection executeQuery: @"CREATE TEMPORARY TABLE baseten_view_pkey AS SELECT * FROM baseten.view_pkey"];
 	NSError* error; //Patch by Tim Bedford 2008-08-11
 	NSString* query = 
-	@"CREATE TEMPORARY TABLE baseten_enabledoids AS "
-	@" SELECT oid FROM pg_class WHERE baseten.isobservingcompatible (oid) = true";
+	@"CREATE TEMPORARY TABLE baseten_enabled_oids AS "
+	@" SELECT relid AS oid FROM baseten.enabled_relation";
 	[connection executeQuery: query];
 	
 	//Patch by Tim Bedford 2008-08-11

Resources/BaseTenModifications.sql.m4

 
 changequote(`{{', `}}')
 -- ' -- Fix for syntax coloring in SQL mode.
-define({{_bx_version_}}, {{0.922}})dnl
+define({{_bx_version_}}, {{0.923}})dnl
 define({{_bx_compat_version_}}, {{0.18}})dnl
 
 
 	relid ALIAS FOR $1;
 	retval "baseten"."reltype";
 BEGIN	 
-	EXECUTE 'DROP FUNCTION IF EXISTS ' || "baseten".mod_insert_fn (relid) || ' () CASCADE';
-	EXECUTE 'DROP TABLE IF EXISTS ' || "baseten".lock_table (relid) || ' CASCADE';
-	EXECUTE 'DROP TABLE IF EXISTS ' || "baseten".mod_table (relid) || ' CASCADE';
+	EXECUTE 'DROP FUNCTION IF EXISTS "baseten".' || "baseten".mod_insert_fn (relid) || ' () CASCADE';
+	EXECUTE 'DROP TABLE IF EXISTS "baseten".' || "baseten".lock_table (relid) || ' CASCADE';
+	EXECUTE 'DROP TABLE IF EXISTS "baseten".' || "baseten".mod_table (relid) || ' CASCADE';
 	DELETE FROM "baseten".enabled_relation r WHERE r.relid = relid;
 	retval := "baseten".reltype (relid);
 	RETURN retval;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.