You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 line
430 B

  1. from __future__ import unicode_literals
  2. import frappe
  3. def execute():
  4. for table in frappe.db.sql_list("show tables"):
  5. for field in frappe.db.sql("desc `%s`" % table):
  6. if field[1]=="datetime":
  7. frappe.db.sql("alter table `%s` change `%s` `%s` datetime(6)" % \
  8. (table, field[0], field[0]))
  9. elif field[1]=="time":
  10. frappe.db.sql("alter table `%s` change `%s` `%s` time(6)" % \
  11. (table, field[0], field[0]))