Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #808 (closed defect: wontfix)

Opened 13 years ago

Last modified 12 years ago

sql upgrade fails with 0.9.5a

Reported by: ivolooser Owned by: anonymous
Priority: normal Milestone: 1.0
Component: SQLObject Version: 0.9a5
Severity: normal Keywords:
Cc:

Description

After quickstart with identity on sqlobject and sql create i added one field to the User class

    password = UnicodeCol( length=40 )
    age = Int()
    created = DateTimeCol( default=datetime.now )

after execution of

D:\Turbogear\project1>c:\Python24\Scripts\tg-admin sql upgrade

i got the error:

Using database URI sqlite:///d|/turbogear/project1/database.db
Traceback (most recent call last):
  File "c:\Python24\Scripts\tg-admin-script.py", line 7, in ?
    sys.exit(
  File "c:\python24\lib\site-packages\TurboGears-0.9a5-py2.4.egg\turbogears\comm
and\base.py", line 275, in main
    command.run()
  File "c:\python24\lib\site-packages\TurboGears-0.9a5-py2.4.egg\turbogears\comm
and\base.py", line 134, in run
    command.the_runner.run(sys.argv)
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobje
ct\manager\command.py", line 102, in run
    runner.run()
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobje
ct\manager\command.py", line 233, in run
    self.command()
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobje
ct\manager\command.py", line 1063, in command
    version_to = os.path.basename(self.find_last_version())
  File "c:\python24\lib\ntpath.py", line 200, in basename
    return split(p)[1]
  File "c:\python24\lib\ntpath.py", line 164, in split
    d, p = splitdrive(p)
  File "c:\python24\lib\ntpath.py", line 119, in splitdrive
    if p[1:2] == ':':
TypeError: unsubscriptable object

D:\Turbogear\project1>

Change History

comment:1 Changed 13 years ago by godoy

  • Status changed from new to closed
  • Resolution set to wontfix

Unfortunately, SQL Object isn't able to upgrade your database. You have to do it manually or drop and recreate the database. This isn't a Turbogears failure, but a failure from both ORMs used (SQL Alchemy also can't update the database).

comment:2 Changed 13 years ago by ivolooser

  • Status changed from closed to reopened
  • Resolution wontfix deleted

Thanks godoy.

But why i have the possibility for tg-admin sql upgrade? It whould be nice when there is at least a nice Message for this command.

comment:3 Changed 13 years ago by godoy

It's a wrapper for sqlobject-admin upgrade.

% sqlobject-admin help upgrade
usage: sqlobject-admin upgrade [options]
Update the database to a new version (as created by record)
This command runs scripts (that you write by hand) to upgrade a database.
The database's current version is in the sqlobject_version table (use record
--force-db-version if a database does not have a sqlobject_version table),
and upgrade scripts are in the version directory you are upgrading FROM,
named upgrade_DBNAME_VERSION.sql, like "upgrade_mysql_2004-12-01b.sql".

and

% tg-admin sql help upgrade
usage: tg-admin upgrade [options]
Update the database to a new version (as created by record)
This command runs scripts (that you write by hand) to upgrade a database.
The database's current version is in the sqlobject_version table (use record
--force-db-version if a database does not have a sqlobject_version table),
and upgrade scripts are in the version directory you are upgrading FROM,
named upgrade_DBNAME_VERSION.sql, like "upgrade_mysql_2004-12-01b.sql".

It is documented... But you still have to write the SQL commands to update your database by hand.

Do you still think that this should be left open?

comment:4 Changed 13 years ago by ivolooser

  • Status changed from reopened to closed
  • Resolution set to wontfix

godoy. Thanks for the hint. I think i got the point.

Note: See TracTickets for help on using tickets.