From 817e14a18596ae1c612e543468a00b4e5515f9af Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 22 Oct 2024 09:53:35 -0700 Subject: [PATCH 1/3] Quote keys for Postgres --- .../migrations/init/seed_permissions.cfc | 188 +++++++++--------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/modules/contentbox/migrations/init/seed_permissions.cfc b/modules/contentbox/migrations/init/seed_permissions.cfc index 04708d64c..1619aee01 100644 --- a/modules/contentbox/migrations/init/seed_permissions.cfc +++ b/modules/contentbox/migrations/init/seed_permissions.cfc @@ -3,191 +3,191 @@ component { function seed( schema, query ){ var perms = [ { - permission : "AUTHOR_ADMIN", - description : "Ability to manage authors, default is view only" + "permission" : "AUTHOR_ADMIN", + "description" : "Ability to manage authors, default is view only" }, { - permission : "CATEGORIES_ADMIN", - description : "Ability to manage categories, default is view only" + "permission" : "CATEGORIES_ADMIN", + "description" : "Ability to manage categories, default is view only" }, { - permission : "COMMENTS_ADMIN", - description : "Ability to manage comments, default is view only" + "permission" : "COMMENTS_ADMIN", + "description" : "Ability to manage comments, default is view only" }, { - permission : "CONTENTBOX_ADMIN", - description : "Access to the enter the ContentBox administrator console" + "permission" : "CONTENTBOX_ADMIN", + "description" : "Access to the enter the ContentBox administrator console" }, { - permission : "CONTENTSTORE_ADMIN", - description : "Ability to manage the content store, default is view only" + "permission" : "CONTENTSTORE_ADMIN", + "description" : "Ability to manage the content store, default is view only" }, { - permission : "CONTENTSTORE_EDITOR", - description : "Ability to create, edit and publish content store elements" + "permission" : "CONTENTSTORE_EDITOR", + "description" : "Ability to create, edit and publish content store elements" }, { - permission : "EDITORS_CACHING", - description : "Ability to view the content caching panel" + "permission" : "EDITORS_CACHING", + "description" : "Ability to view the content caching panel" }, { - permission : "EDITORS_CATEGORIES", - description : "Ability to view the content categories panel" + "permission" : "EDITORS_CATEGORIES", + "description" : "Ability to view the content categories panel" }, { - permission : "EDITORS_CUSTOM_FIELDS", - description : "Ability to manage custom fields in any content editors" + "permission" : "EDITORS_CUSTOM_FIELDS", + "description" : "Ability to manage custom fields in any content editors" }, { - permission : "EDITORS_DISPLAY_OPTIONS", - description : "Ability to view the content display options panel" + "permission" : "EDITORS_DISPLAY_OPTIONS", + "description" : "Ability to view the content display options panel" }, { - permission : "EDITORS_EDITOR_SELECTOR", - description : "Ability to change the editor to another registered online editor" + "permission" : "EDITORS_EDITOR_SELECTOR", + "description" : "Ability to change the editor to another registered online editor" }, { - permission : "EDITORS_FEATURED_IMAGE", - description : "Ability to view the featured image panel" + "permission" : "EDITORS_FEATURED_IMAGE", + "description" : "Ability to view the featured image panel" }, { - permission : "EDITORS_HTML_ATTRIBUTES", - description : "Ability to view the content HTML attributes panel" + "permission" : "EDITORS_HTML_ATTRIBUTES", + "description" : "Ability to view the content HTML attributes panel" }, { - permission : "EDITORS_LINKED_CONTENT", - description : "Ability to view the linked content panel" + "permission" : "EDITORS_LINKED_CONTENT", + "description" : "Ability to view the linked content panel" }, { - permission : "EDITORS_MODIFIERS", - description : "Ability to view the content modifiers panel" + "permission" : "EDITORS_MODIFIERS", + "description" : "Ability to view the content modifiers panel" }, { - permission : "EDITORS_RELATED_CONTENT", - description : "Ability to view the related content panel" + "permission" : "EDITORS_RELATED_CONTENT", + "description" : "Ability to view the related content panel" }, { - permission : "EMAIL_TEMPLATE_ADMIN", - description : "Ability to admin and preview email templates" + "permission" : "EMAIL_TEMPLATE_ADMIN", + "description" : "Ability to admin and preview email templates" }, { - permission : "ENTRIES_ADMIN", - description : "Ability to manage blog entries, default is view only" + "permission" : "ENTRIES_ADMIN", + "description" : "Ability to manage blog entries, default is view only" }, { - permission : "ENTRIES_EDITOR", - description : "Ability to create, edit and publish blog entries" + "permission" : "ENTRIES_EDITOR", + "description" : "Ability to create, edit and publish blog entries" }, { - permission : "FORGEBOX_ADMIN", - description : "Ability to manage ForgeBox installations and connectivity." + "permission" : "FORGEBOX_ADMIN", + "description" : "Ability to manage ForgeBox installations and connectivity." }, { - permission : "GLOBAL_SEARCH", - description : "Ability to do global searches in the ContentBox Admin" + "permission" : "GLOBAL_SEARCH", + "description" : "Ability to do global searches in the ContentBox Admin" }, { - permission : "GLOBALHTML_ADMIN", - description : "Ability to manage the system's global HTML content used on layouts" + "permission" : "GLOBALHTML_ADMIN", + "description" : "Ability to manage the system's global HTML content used on layouts" }, { - permission : "MEDIAMANAGER_ADMIN", - description : "Ability to manage the system's media manager" + "permission" : "MEDIAMANAGER_ADMIN", + "description" : "Ability to manage the system's media manager" }, { - permission : "MEDIAMANAGER_LIBRARY_SWITCHER", - description : "Ability to switch media manager libraries for management" + "permission" : "MEDIAMANAGER_LIBRARY_SWITCHER", + "description" : "Ability to switch media manager libraries for management" }, { - permission : "MENUS_ADMIN", - description : "Ability to manage the menu builder" + "permission" : "MENUS_ADMIN", + "description" : "Ability to manage the menu builder" }, { - permission : "MODULES_ADMIN", - description : "Ability to manage ContentBox Modules" + "permission" : "MODULES_ADMIN", + "description" : "Ability to manage ContentBox Modules" }, { - permission : "PAGES_ADMIN", - description : "Ability to manage content pages, default is view only" + "permission" : "PAGES_ADMIN", + "description" : "Ability to manage content pages, default is view only" }, { - permission : "PAGES_EDITOR", - description : "Ability to create, edit and publish pages" + "permission" : "PAGES_EDITOR", + "description" : "Ability to create, edit and publish pages" }, { - permission : "PERMISSIONS_ADMIN", - description : "Ability to manage permissions, default is view only" + "permission" : "PERMISSIONS_ADMIN", + "description" : "Ability to manage permissions, default is view only" }, { - permission : "RELOAD_MODULES", - description : "Ability to reload modules" + "permission" : "RELOAD_MODULES", + "description" : "Ability to reload modules" }, { - permission : "RELOAD_CACHES", - description : "Ability to reload caches" + "permission" : "RELOAD_CACHES", + "description" : "Ability to reload caches" }, { - permission : "ROLES_ADMIN", - description : "Ability to manage roles, default is view only" + "permission" : "ROLES_ADMIN", + "description" : "Ability to manage roles, default is view only" }, { - permission : "SECURITYRULES_ADMIN", - description : "Ability to manage the system's security rules, default is view only" + "permission" : "SECURITYRULES_ADMIN", + "description" : "Ability to manage the system's security rules, default is view only" }, { - permission : "SITES_ADMIN", - description : "Ability to manage sites" + "permission" : "SITES_ADMIN", + "description" : "Ability to manage sites" }, { - permission : "SYSTEM_AUTH_LOGS", - description : "Access to the system auth logs" + "permission" : "SYSTEM_AUTH_LOGS", + "description" : "Access to the system auth logs" }, { - permission : "SYSTEM_RAW_SETTINGS", - description : "Access to the ContentBox raw geek settings panel" + "permission" : "SYSTEM_RAW_SETTINGS", + "description" : "Access to the ContentBox raw geek settings panel" }, { - permission : "SYSTEM_SAVE_CONFIGURATION", - description : "Ability to update global configuration data" + "permission" : "SYSTEM_SAVE_CONFIGURATION", + "description" : "Ability to update global configuration data" }, { - permission : "SYSTEM_TAB", - description : "Access to the ContentBox System tools" + "permission" : "SYSTEM_TAB", + "description" : "Access to the ContentBox System tools" }, { - permission : "SYSTEM_UPDATES", - description : "Ability to view and apply ContentBox updates" + "permission" : "SYSTEM_UPDATES", + "description" : "Ability to view and apply ContentBox updates" }, { - permission : "THEME_ADMIN", - description : "Ability to manage layouts, default is view only" + "permission" : "THEME_ADMIN", + "description" : "Ability to manage layouts, default is view only" }, { - permission : "TOOLS_EXPORT", - description : "Ability to export data from ContentBox" + "permission" : "TOOLS_EXPORT", + "description" : "Ability to export data from ContentBox" }, { - permission : "TOOLS_IMPORT", - description : "Ability to import data into ContentBox" + "permission" : "TOOLS_IMPORT", + "description" : "Ability to import data into ContentBox" }, { - permission : "VERSIONS_DELETE", - description : "Ability to delete past content versions" + "permission" : "VERSIONS_DELETE", + "description" : "Ability to delete past content versions" }, { - permission : "VERSIONS_ROLLBACK", - description : "Ability to rollback content versions" + "permission" : "VERSIONS_ROLLBACK", + "description" : "Ability to rollback content versions" }, { - permission : "WIDGET_ADMIN", - description : "Ability to manage widgets, default is view only" + "permission" : "WIDGET_ADMIN", + "description" : "Ability to manage widgets, default is view only" } ]; perms = perms.map( ( thisPerm ) => { - thisPerm.permissionID = createUUID(); - thisPerm.isDeleted = 0; - thisPerm.createdDate = thisPerm.modifiedDate = now(); + thisPerm[ "permissionID" ] = createUUID(); + thisPerm[ "isDeleted" ] = 0; + thisPerm[ "createdDate" ] = thisPerm[ "modifiedDate" ] = now(); return thisPerm; } ); @@ -196,7 +196,7 @@ component { .from( "cb_permission" ) .insert( perms ); - systemOutput( "√ Permissions seeded", true ); + systemOutput( "√ "Permission"s seeded", true ); } } From 6be40444fd5b8a71cfde186b03bd148acde68898 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 22 Oct 2024 09:54:34 -0700 Subject: [PATCH 2/3] More quoting column fixes --- .../contentbox/migrations/init/seed_roles.cfc | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/contentbox/migrations/init/seed_roles.cfc b/modules/contentbox/migrations/init/seed_roles.cfc index 1ac61b4b4..92b8e4b87 100644 --- a/modules/contentbox/migrations/init/seed_roles.cfc +++ b/modules/contentbox/migrations/init/seed_roles.cfc @@ -2,20 +2,20 @@ component { function seed( schema, query ){ var admin = { - roleID : createUUID(), - isDeleted : 0, - createdDate : now(), - modifiedDate : now(), - role : "Administrator", - description : "A ContentBox Administrator" + "roleID" : createUUID(), + "isDeleted" : 0, + "createdDate" : now(), + "modifiedDate" : now(), + "role" : "Administrator", + "description" : "A ContentBox Administrator" }; var editor = { - roleID : createUUID(), - isDeleted : 0, - createdDate : now(), - modifiedDate : now(), - role : "Editor", - description : "A ContentBox Editor" + "roleID" : createUUID(), + "isDeleted" : 0, + "createdDate" : now(), + "modifiedDate" : now(), + "role" : "Editor", + "description" : "A ContentBox Editor" }; // ADMIN ROLE @@ -35,8 +35,8 @@ component { .newQuery() .from( "cb_rolePermissions" ) .insert( { - FK_permissionID : record.permissionID, - FK_roleID : admin.roleID + "FK_permissionID" : record.permissionID, + "FK_roleID" : admin.roleID } ); } ); @@ -86,8 +86,8 @@ component { .newQuery() .from( "cb_rolePermissions" ) .insert( { - FK_permissionID : record.permissionID, - FK_roleID : editor.roleID + "FK_permissionID" : record.permissionID, + "FK_roleID" : editor.roleID } ); } ); From a402070885cdb2d843d178f8150fecaa9b8049ba Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 22 Oct 2024 09:55:22 -0700 Subject: [PATCH 3/3] More quoting fixes --- modules/contentbox/migrations/util/MigrationUtils.cfm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/contentbox/migrations/util/MigrationUtils.cfm b/modules/contentbox/migrations/util/MigrationUtils.cfm index ae5d74ffb..0d0685581 100644 --- a/modules/contentbox/migrations/util/MigrationUtils.cfm +++ b/modules/contentbox/migrations/util/MigrationUtils.cfm @@ -107,8 +107,8 @@ function addPermissionToRole( query, roleId, permission ){ .newQuery() .from( "cb_rolePermissions" ) .insert( { - FK_roleID : arguments.roleId, - FK_permissionID : permissionId + "FK_roleID" : arguments.roleId, + "FK_permissionID" : permissionId } ); }