From 3878b2a1ac45c2956a3e1627594809fa76ad02c2 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 14 Jun 2012 18:28:29 +0530 Subject: [PATCH] add unique constraint to tabSeries name column --- erpnext/patches/june_2012/series_unique_patch.py | 6 ++++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 erpnext/patches/june_2012/series_unique_patch.py diff --git a/erpnext/patches/june_2012/series_unique_patch.py b/erpnext/patches/june_2012/series_unique_patch.py new file mode 100644 index 0000000000..6f85f21df3 --- /dev/null +++ b/erpnext/patches/june_2012/series_unique_patch.py @@ -0,0 +1,6 @@ +def execute(): + """add unique constraint to series table's name column""" + import webnotes + webnotes.conn.commit() + webnotes.conn.sql("alter table `tabSeries` add unique (name)") + webnotes.conn.begin() \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 87c96c135a..98c3aff772 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -437,4 +437,9 @@ patch_list = [ 'patch_file': 'support_ticket_autoreply', 'description': 'New Send Autoreply checkbox in Email Settings' }, + { + 'patch_module': 'patches.june_2012', + 'patch_file': 'series_unique_patch', + 'description': "add unique constraint to series table's name column" + }, ] \ No newline at end of file