예제 #1
0
    def run(self):
        print "running script to convert from schema 2.1 to 2.2"
        try:
            #- execute the SQL commands
            self.progressSig(5, _("creating tables"))
            self.execute_statements(SQLSTRINGS)

            self.progressSig(10, _("populating est_link table"))
            self.transfer_data()

            self.progressSig(95, _("populating feescales"))
            self.insert_feescales()

            self.progressSig(97, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.2",), "2_1 to 2_2 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 2.2")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.1"
            self.completeSig(_("rolled back to") + " 2.1")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #2
0
    def run(self):
        print "running script to convert from schema 2.0 to 2.1"
        try:
            #- execute the SQL commands
            self.progressSig(5, _("creating currtrtmt2 table"))
            self.execute_statements(SQLSTRINGS)
            self.progressSig(10, _('transferring data'))

            self.transfer_data()

            self.progressSig(95, _("deleting void courses"))
            self.execute_statements([GARBAGE_QUERY, CORRECTION_QUERY])

            self.progressSig(97, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.1",), "2_0 to 2_1 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 2.1")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.0"
            self.completeSig(_("rolled back to") + " 2.0")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #3
0
    def run(self):
        print "running script to convert from schema 1.6 to 1.7"
        try:
            #- execute the SQL commands
            self.progressSig(20, _("executing statements"))
            self.create_alter_tables()

            #- transfer data between tables
            self.progressSig(60, _('inserting values'))
                
            print "inserting values"
            if self.insertValues():
                print "ok"
            else:
                print "FAILED!!!!!"            

            self.progressSig(90, _('updating settings'))
            print "update database settings..." 
            
            schema_version.update(("1.6","1.7",), "1_6 to 1_7 script")
            
            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
            + " 1.7 " + _("you may now remove old feetables"))
        
        except UpdateException, e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.6"
            self.completeSig(_("rolled back to") + " 1.6")
예제 #4
0
    def run(self):
        print "running script to convert from schema 1.4 to 1.5"
        try:
            #- execute the SQL commands
            self.progressSig(20, _("executing statements"))
            self.create_alter_tables()

            #- transfer data between tables
            self.progressSig(50, _('transfering data'))

            print "transfering data to new table, ...",
            if self.transferData():
                print "ok"
            else:
                print "FAILED!!!!!"

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update(("1.5",), "1_4 to 1_5 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 1.5")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.4"
            self.completeSig(_("rolled back to") + " 1.4")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #5
0
    def run(self):
        print "running script to convert from schema 1.6 to 1.7"
        try:
            #- execute the SQL commands
            self.progressSig(20, _("executing statements"))
            self.create_alter_tables()

            #- transfer data between tables
            self.progressSig(60, _('inserting values'))

            print "inserting values"
            if self.insertValues():
                print "ok"
            else:
                print "FAILED!!!!!"

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update((
                "1.6",
                "1.7",
            ), "1_6 to 1_7 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(
                _("ALL DONE - sucessfully moved db to") + " 1.7 " +
                _("you may now remove old feetables"))

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.6"
            self.completeSig(_("rolled back to") + " 1.6")

        return self.completed
예제 #6
0
    def run(self):
        print "running script to convert from schema 1.3 to 1.4"
        try:
            #- execute the SQL commands
            self.progressSig(10, _("creating new tables"))
            self.create_alter_tables()

            #- transfer data
            self.progressSig(20,
            _("copying data across from old feetable"))
            self.transferData()

            #- update the schema version
            #pass a tuple of compatible clients and the "user"
            #who made these changes.
            #only 1.4 client will work now.

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update(("1.4",), "1_3 to 1_4 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
            + " 1.4")

        except UpdateException, e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.3"
            self.completeSig(_("rolled back to") + " 1.3")
예제 #7
0
    def run(self):
        print "running script to convert from schema 2.2 to 2.3"
        try:
            #- execute the SQL commands
            self.progressSig(5, _("creating est_link2 table"))
            self.execute_statements(SQLSTRINGS)

            self.progressSig(10, _("populating est_link2 table"))
            self.transfer_data()

            self.progressSig(95, _("executing cleanup statements"))
            self.execute_statements(CLEANUPSTRINGS)

            self.progressSig(97, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.3",), "2_2 to 2_3 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 2.3")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.2"
            self.completeSig(_("rolled back to") + " 2.2")

        except Exception as exc:
            logging.exception("Exception caught")
            self.completeSig(str(exc))

        return self.completed
예제 #8
0
    def run(self):
        print "running script to convert from schema 2.3 to 2.4"
        try:
            #- execute the SQL commands
            self.progressSig(50, _("creating est_link2 table"))
            self.execute_statements(SQLSTRINGS)

            # self.progressSig(30, _("transferring data"))
            # self.transfer_data()

            self.progressSig(95, _("executing cleanup statements"))
            self.execute_statements(CLEANUPSTRINGS)

            self.progressSig(97, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.4",), "2_3 to 2_4 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 2.4")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.3"
            self.completeSig(_("rolled back to") + " 2.3")

        except Exception as exc:
            logging.exception("Exception caught")
            self.completeSig(str(exc))

        return self.completed
예제 #9
0
    def run(self):
        print "running script to convert from schema 1.2 to 1.3"
        try:
            self.progressSig(10, _("creating new tables"))
            if self.create_alter_tables():
                self.progressSig(90, _('updating settings'))
                print "update database settings..."

                # pass a tuple of compatible clients and the "user"
                # who made these changes.
                schema_version.update(("1.2", "1.3"), "1_2 to 1_3 script")

                self.progressSig(100, _("updating stored schema version"))
                self.completed = True
                self.completeSig(_("ALL DONE - sucessfully moved db to")
                                 + " 1.3")
            else:
                localsettings.CLIENT_SCHEMA_VERSION = " 1.2"
                self.completeSig(_("couldn't create tables, rolled back to")
                                 + "1.2")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #10
0
    def run(self):
        print "running script to convert from schema 1.2 to 1.3"
        try:
            self.progressSig(10, _("creating new tables"))
            if self.create_alter_tables():
                self.progressSig(90, _('updating settings'))
                print "update database settings..."

                # pass a tuple of compatible clients and the "user"
                # who made these changes.
                schema_version.update(("1.2", "1.3"), "1_2 to 1_3 script")

                self.progressSig(100, _("updating stored schema version"))
                self.completed = True
                self.completeSig(
                    _("ALL DONE - sucessfully moved db to") + " 1.3")
            else:
                localsettings.CLIENT_SCHEMA_VERSION = " 1.2"
                self.completeSig(
                    _("couldn't create tables, rolled back to") + "1.2")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #11
0
    def run(self):
        print "running script to convert from schema 2.0 to 2.1"
        try:
            #- execute the SQL commands
            self.progressSig(5, _("creating currtrtmt2 table"))
            self.execute_statements(SQLSTRINGS)
            self.progressSig(10, _('transferring data'))

            self.transfer_data()

            self.progressSig(95, _("deleting void courses"))
            self.execute_statements([GARBAGE_QUERY, CORRECTION_QUERY])

            self.progressSig(97, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.1", ), "2_0 to 2_1 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to") + " 2.1")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.0"
            self.completeSig(_("rolled back to") + " 2.0")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #12
0
    def run(self):
        print "running script to convert from schema 1.8 to 1.9"
        try:
            #- execute the SQL commands
            self.progressSig(2, _("executing statements"))
            self.create_alter_tables()
            self.progressSig(8, _('inserting values'))

            print "inserting values"
            if self.insertValues():
                print "ok"
            else:
                print "FAILED!!!!!"

            self.progressSig(99, _('updating settings'))
            print "update database settings..."

            schema_version.update(("1.9",), "1_8 to 1_9 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
                             + " 1.9")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.8"
            self.completeSig(_("rolled back to") + " 1.8")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #13
0
    def run(self):
        print "running script to convert from schema 2.2 to 2.3"
        try:
            # - execute the SQL commands
            self.progressSig(5, _("creating est_link2 table"))
            self.execute_statements(SQLSTRINGS)

            self.progressSig(10, _("populating est_link2 table"))
            self.transfer_data()

            self.progressSig(95, _("executing cleanup statements"))
            self.execute_statements(CLEANUPSTRINGS)

            self.progressSig(97, _("updating settings"))
            print "update database settings..."

            schema_version.update(("2.3",), "2_2 to 2_3 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to") + " 2.3")

        except UpdateException, e:
            localsettings.CLIENT_SCHEMA_VERSION = "2.2"
            self.completeSig(_("rolled back to") + " 2.2")
예제 #14
0
    def run(self):
        print "running script to convert from schema 1.3 to 1.4"
        try:
            #- execute the SQL commands
            self.progressSig(10, _("creating new tables"))
            self.create_alter_tables()

            #- transfer data
            self.progressSig(20, _("copying data across from old feetable"))
            self.transferData()

            #- update the schema version
            # pass a tuple of compatible clients and the "user"
            # who made these changes.
            # only 1.4 client will work now.

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update(("1.4", ), "1_3 to 1_4 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to") + " 1.4")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.3"
            self.completeSig(_("rolled back to") + " 1.3")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #15
0
    def run(self):
        print "running script to convert from schema 1.9 to 2.0"
        try:
            #- execute the SQL commands
            self.progressSig(10, _("creating new appt_prefs table"))
            self.execute_statements(SQLSTRINGS_1)
            self.progressSig(50, _('copying data'))
            self.execute_statements(SQLSTRINGS_2)
            self.progressSig(80, _('statements executed'))

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.0", ), "1_9 to 2_0 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to") + " 2.0")

        except UpdateException as e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.9"
            self.completeSig(_("rolled back to") + " 1.9")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #16
0
 def run(self):
     print "running script to convert from schema 1.1 to 1.2"
     try:
         self.progressSig(30, "updating schema to 1,2")
         if create_alter_tables():
             self.progressSig(50, 'created new table "forumread"')
             
             if copy_OMforum_into_forum():
                 self.progressSig(80, 
                 'copied data from obsolete table OMforum')
             
             schema_version.update(("1.2",), "1_1 to 1_2 script")
             
             self.progressSig(100, _("updating stored schema version"))
             self.completed = True
             self.completeSig(_("ALL DONE - sucessfully moved db to")
             +" 1.2")
         
     except Exception, e:
         print "Exception caught",e
         self.completeSig(str(e))
예제 #17
0
 def run(self):
     print "running script to convert from schema 1.0 to 1.1"
     try:
         if self.createNewTables():
             self.progressSig(10, "extracting estimates")
             oldrows = self.getRowsFromOld()
             self.progressSig(20, "converting data")
             newRows = self.convertData(oldrows)
             
             self.progressSig(40, "exporting into newestimates table")
             print 'now exporting, this can take some time'
             self.insertRowsIntoNew(newRows)
             self.progressSig(90, "updating stored schema version")
             schema_version.update(("1.1",), "1_0 to 1_1 script")
             
             self.progressSig(100)
             self.completed = True
             self.completeSig("ALL DONE - sucessfully moved db to 1,1")
         
     except Exception, e:
         print "Exception caught",e
         self.completeSig(str(e))
예제 #18
0
    def run(self):
        print "running script to convert from schema 1.1 to 1.2"
        try:
            self.progressSig(30, "updating schema to 1,2")
            if create_alter_tables():
                self.progressSig(50, 'created new table "forumread"')

                if copy_OMforum_into_forum():
                    self.progressSig(
                        80, 'copied data from obsolete table OMforum')

                schema_version.update(("1.2", ), "1_1 to 1_2 script")

                self.progressSig(100, _("updating stored schema version"))
                self.completed = True
                self.completeSig(
                    _("ALL DONE - sucessfully moved db to") + " 1.2")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #19
0
    def run(self):
        print "running script to convert from schema 1.9 to 2.0"
        try:
            #- execute the SQL commands
            self.progressSig(10, _("creating new appt_prefs table"))
            self.execute_statements(SQLSTRINGS_1)
            self.progressSig(50, _('copying data'))
            self.execute_statements(SQLSTRINGS_2)
            self.progressSig(80, _('statements executed'))

            self.progressSig(90, _('updating settings'))
            print "update database settings..."

            schema_version.update(("2.0",), "1_9 to 2_0 script")

            self.progressSig(100, _("updating stored schema version"))
            self.completed = True
            self.completeSig(_("ALL DONE - sucessfully moved db to")
            + " 2.0")

        except UpdateException, e:
            localsettings.CLIENT_SCHEMA_VERSION = "1.9"
            self.completeSig(_("rolled back to") + " 1.9")
예제 #20
0
    def run(self):
        print "running script to convert from schema 1.0 to 1.1"
        try:
            if self.createNewTables():
                self.progressSig(10, "extracting estimates")
                oldrows = self.getRowsFromOld()
                self.progressSig(20, "converting data")
                newRows = self.convertData(oldrows)

                self.progressSig(40, "exporting into newestimates table")
                print 'now exporting, this can take some time'
                self.insertRowsIntoNew(newRows)
                self.progressSig(90, "updating stored schema version")
                schema_version.update(("1.1", ), "1_0 to 1_1 script")

                self.progressSig(100)
                self.completed = True
                self.completeSig("ALL DONE - sucessfully moved db to 1,1")

        except Exception as e:
            print "Exception caught", e
            self.completeSig(str(e))

        return self.completed
예제 #21
0
 def update_schema_version(self, compatible_versions, message):
     schema_version.update(compatible_versions, message)
예제 #22
0
 def update_schema_version(self, compatible_versions, message):
     schema_version.update(compatible_versions, message)