Modify

Ticket #226 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Sqlite doesn't support app names with underscores in them for column opperations

Reported by: caleb_brown@… Owned by: andrew
Priority: major Milestone: 0.6.1
Component: databaseapi Version: 0.6
Keywords: Cc:

Description

We are using an sqlite3 database.

We ran code like this in a migration:

db.rename_column('app_name_modelname', 'column', 'new_column')

This error was returned:

KeyError: "The model 'name_modelname' from the app 'app' is not available in this migration."

The problem appears to be with the DatabaseOperations::_alter_sqlite_table() method in south.db.sqlite3

In particular, the following line treats only the characters before the first underscore as the app name:

model_name = table_name.replace('_', '.', 1)

Attachments

Change History

comment:1 Changed 2 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.6.1

Fixed in [f44c3e3cc52c].

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.