mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-22 16:02:16 +00:00
Add updating sequences to importer.
This commit is contained in:
11
importer.py
11
importer.py
@@ -345,6 +345,7 @@ def main():
|
|||||||
# [x.start() for x in processs]
|
# [x.start() for x in processs]
|
||||||
# # Wait for all processs to finish
|
# # Wait for all processs to finish
|
||||||
# [x.join() for x in processs]
|
# [x.join() for x in processs]
|
||||||
|
|
||||||
import_users()
|
import_users()
|
||||||
import_people(True)
|
import_people(True)
|
||||||
import_organisations(True)
|
import_organisations(True)
|
||||||
@@ -354,8 +355,18 @@ def main():
|
|||||||
import_rigs(True)
|
import_rigs(True)
|
||||||
import_eventitem(True)
|
import_eventitem(True)
|
||||||
import_invoices(True)
|
import_invoices(True)
|
||||||
|
|
||||||
|
# Do this before doing non rigs else it gets ugly
|
||||||
|
sql = "SELECT setval(\'\"RIGS_%s_id_seq\"\', (SELECT MAX(id) FROM \"RIGS_%s\"));" % ('event', 'event')
|
||||||
|
cursor = connections['default'].cursor()
|
||||||
|
cursor.execute(sql)
|
||||||
import_nonrigs(False)
|
import_nonrigs(False)
|
||||||
|
|
||||||
|
sequences = ['profile', 'person', 'organisation', 'vatrate', 'venue', 'event', 'eventitem', 'invoice', 'payment']
|
||||||
|
for seq in sequences:
|
||||||
|
sql = "SELECT setval(\'\"RIGS_%s_id_seq\"\', (SELECT MAX(id) FROM \"RIGS_%s\"));" % (seq, seq)
|
||||||
|
cursor = connections['default'].cursor()
|
||||||
|
cursor.execute(sql)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user