Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12366 closed defect (cantfix)

Problem on trac database migrate.

Reported by: Amrit Kshetri <kshetriamrit@…> Owned by: Jun Omae
Priority: normal Component: TracMigratePlugin
Severity: normal Keywords:
Cc: Trac Release:

Description (last modified by Jun Omae)

Hi, I tried to migrate database from sqlite to mysql. I tried to use methods mentioned on TracMigratePlugin.

After completing process provided there and tried to create new ticket, I got this error

Table 'trac.sqlite_master' doesn't exist

Am I doing some thing wrong?

Attachments (0)

Change History (6)

comment:1 Changed 9 years ago by Jun Omae

Description: modified (diff)

Strange. It consider that one of installed plugins doesn't support databases other than SQLite. Could you please post the details about:

  • What version of Trac and installed plugins are you using? See System Information from your /about page.
  • Stack trace of the error in trac.log after TracLogging is enabled with DEBUG level.

comment:3 Changed 9 years ago by Jun Omae

Keywords: needinfo added

comment:4 Changed 9 years ago by Amrit Kshetri <kshetriamrit@…>

Hi, sorry for delayed response.

In my environment, we are using our custom authentication plugin using our own user database.

In one of the method

# ITicketChangeListener methods
def ticket_created(self, ticket):

there is hard coded query using sqlite_master table. The code snippet is.

table = cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='customer_ticket_identifier';")
        if not table.fetchall():
            cursor.execute("""CREATE TABLE %s(ticket_id int, distributor_id varchar(30),
                           retailer_id varchar(30), customer_id varchar(30))""" % table_name)

which seems like it is our own requirement. (I am not the original developer of the plugin).

Seems like if this code is removed, it will do no harm.

Can you guys provide some insight on this?

Last edited 9 years ago by Jun Omae (previous) (diff)

comment:5 Changed 9 years ago by Jun Omae

Keywords: needinfo removed
Resolution: cantfix
Status: newclosed

If you are using Trac 1.0.3 or later, you can use get_table_names(), which is introduced in trac:r12710, to retrieve a list of table names.

comment:6 Changed 9 years ago by Ryan J Ollos

Or even go a step further and redesign your plugin to create the table in an IEnvironmentSetupParticipant. Creating a table in an ITicketChangeListener method is quite a hack!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.