Patch for user permissions (#5389)

* Drop column apply_user_permissions from DocPerm and Custom DocPerm

* add patches.txt

* add __init__.py
This commit is contained in:
Suraj Shetty 2018-04-05 16:32:28 +05:30 committed by Rushabh Mehta
parent a8b62f3cff
commit 8041d04bf9
3 changed files with 11 additions and 0 deletions

View file

@ -205,3 +205,4 @@ frappe.patches.v10_0.refactor_social_login_keys
frappe.patches.v10_0.enable_chat_by_default_within_system_settings
frappe.patches.v10_0.remove_custom_field_for_disabled_domain
execute:frappe.delete_doc("Page", "chat")
frappe.patches.v11_0.drop_column_apply_user_permissions

View file

View file

@ -0,0 +1,10 @@
import frappe
def execute():
column = 'apply_user_permissions'
to_remove = ['DocPerm', 'Custom DocPerm']
for doctype in to_remove:
if column in frappe.db.get_table_columns(doctype):
frappe.db.sql("alter table `tab{0}` drop column {1}".format(doctype, column))