Beispiel #1
0
    def upgrade_environment(self, db):
        """Actually perform an environment upgrade.
        
        Implementations of this method should not commit any database
        transactions. This is done implicitly after all participants have
        performed the upgrades they need without an error being raised.
        """

        # create a table for ticket location
        ticket_location_table = Table("ticket_location", key="ticket")[
            Column("ticket", type="int"),
            Column("latitude", type="float"),
            Column("longitude", type="float"),
            Index(["ticket"]),
        ]
        create_table(self.env, ticket_location_table)

        # update ticket locations
        tickets = get_column(self.env, "ticket", "id")
        tickets = [Ticket(self.env, ticket) for ticket in tickets]
        for ticket in tickets:
            try:
                location, (lat, lon) = self.locate_ticket(ticket)
                self.set_location(ticket.id, lat, lon)
            except GeolocationException:
                pass

        # note the DB version
        execute_non_query(self.env, "insert into system (name, value) values ('geoticket.db_version', '1');")

        # add a default dashboard panel
        self.default_dashboard()
Beispiel #2
0
    def upgrade_environment(self, db):
        """Actually perform an environment upgrade.
        
        Implementations of this method should not commit any database
        transactions. This is done implicitly after all participants have
        performed the upgrades they need without an error being raised.
        """

        # create a table for ticket location
        ticket_location_table = Table(
            'ticket_location', key='ticket')[Column('ticket', type='int'),
                                             Column('latitude', type='float'),
                                             Column('longitude', type='float'),
                                             Index(['ticket'])]
        create_table(self.env, ticket_location_table)

        # update ticket locations
        tickets = get_column(self.env, 'ticket', 'id')
        tickets = [Ticket(self.env, ticket) for ticket in tickets]
        for ticket in tickets:
            try:
                location, (lat, lon) = self.locate_ticket(ticket)
                self.set_location(ticket.id, lat, lon)
            except GeolocationException:
                pass

        # note the DB version
        execute_non_query(
            self.env,
            "insert into system (name, value) values ('geoticket.db_version', '1');"
        )

        # add a default dashboard panel
        self.default_dashboard()
    def create_db(self):
        autocomplete_table = Table('autocomplete', key='name')[ 
                                Column('name', 'text'),
                                Column('description', 'text')]
        autocomplete_values_table = Table('autocomplete_values')[
                                Column('autocomplete_name', 'text'), 
                                Column('value', 'text')]

        create_table(self.env, autocomplete_table)
        create_table(self.env, autocomplete_values_table)
        execute_non_query(self.env, """INSERT INTO system (name, value) VALUES 
                                    ('autocompleteplugin.db_version', '1');""")
Beispiel #4
0
    def upgrade_environment(self, db):
        """Actually perform an environment upgrade.
        
        Implementations of this method should not commit any database
        transactions. This is done implicitly after all participants have
        performed the upgrades they need without an error being raised.
        """

        # table of CAPTCHAs
        captcha_table = Table('captcha', key='key')[Column('id'),
                                                    Column('word')]
        create_table(self.env, captcha_table)
Beispiel #5
0
    def upgrade_environment(self, db):
        """Actually perform an environment upgrade.
        
        Implementations of this method should not commit any database
        transactions. This is done implicitly after all participants have
        performed the upgrades they need without an error being raised.
        """

        # table of CAPTCHAs
        captcha_table = Table('captcha', key='key')[
            Column('id'),
            Column('word')]
        create_table(self.env, captcha_table)
    def create_db(self):
        repo_cache_table = Table("repository_node", key=("id"))[
            Column("id", auto_increment=True), Column("repo"), Column("filename"), Column("contents")
        ]
        create_table(self.env, repo_cache_table)

        repo_version_table = Table("repository_version", key=("id"))[
            Column("id", auto_increment=True), Column("repo"), Column("version")
        ]
        create_table(self.env, repo_version_table)

        execute_non_query(
            self.env, "insert into system (name, value) values ('multireposearch.sqlindexer.db_version', '1');"
        )
    def create_db(self):
        repo_cache_table = Table('repository_node', key=('id'))[
            Column('id', auto_increment=True),
            Column('repo'),
            Column('filename'),
            Column('contents'),
            ]
        create_table(self.env, repo_cache_table)

        repo_version_table = Table('repository_version', key=('id'))[
            Column('id', auto_increment=True),
            Column('repo'),
            Column('version'),
            ]
        create_table(self.env, repo_version_table)

        execute_non_query(self.env, "insert into system (name, value) values ('multireposearch.sqlindexer.db_version', '1');")
Beispiel #8
0
    def create_db(self):
        default_image = Table('default_image',
                              key=('ticket', ))[Column('ticket', type='int'),
                                                Column('image'), ]

        create_table(self.env, default_image)
Beispiel #9
0
    def create_db(self):
        default_image = Table("default_image", key=("ticket",))[Column("ticket", type="int"), Column("image")]

        create_table(self.env, default_image)