chore: clean up database schema sync for virtual doctype
Co-authored-by: Chinmay D. Pai <chinmay.pai@zerodha.com> Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
This commit is contained in:
parent
7b16837f88
commit
86f9747925
1 changed files with 5 additions and 2 deletions
|
|
@ -30,9 +30,12 @@ class DBTable:
|
|||
self.get_columns_from_docfields()
|
||||
|
||||
def sync(self):
|
||||
if self.is_new() and not self.meta.get('virtual_doctype'):
|
||||
if self.meta.get('virtual_doctype'):
|
||||
# no schema to sync for virtual doctypes
|
||||
return
|
||||
if self.is_new():
|
||||
self.create()
|
||||
elif not self.meta.get('virtual_doctype'):
|
||||
else:
|
||||
frappe.cache().hdel('table_columns', self.table_name)
|
||||
self.alter()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue