> You are correct, sqlite doesn't fully support ALTER statements. See
> http://www.sqlite.org/omitted.html for a full list of unsupported features.

Oh, I know. I was trying to be extra conservative and nice, and give
someone a way out...*grin*

The primary point would be that the
http://code.djangoproject.com/wiki/RemovingTheMagic description:

"We've renamed a bunch of the core Django tables. To upgrade in MySQL
and SQLite, execute this SQL in your database:

...

ALTER TABLE django_content_type rename package to app_label;
ALTER TABLE django_content_type rename python_module_name to model;
"
is incorrect. And presumably never even tested against SQLite, since it
throws an immediate error.

A SQLite workaround script is as follows:

 CREATE TABLE "django_content_type_new"  (
"id" integer NOT NULL PRIMARY KEY,
"name" varchar(100) NOT NULL,
"app_label" varchar(100) NOT NULL,
"model" varchar(100) NOT NULL,
UNIQUE ("app_label", "model")
);

insert into django_content_type_new
(id,name,app_label,model)
select id,name,package,python_module_name
from django_content_type;

alter table django_content_type rename to django_content_type_old;
alter table django_content_type_new rename to django_content_type;

(when you're COMPLETELY satisfied that you haven't lost any data, you
can drop the old table with:

drop table django_content_type_old;
)


It's not the end of the world if this stuff needs a little tweaking,
but I hope this kind of thing can get nailed down before the trunk
commit. (Disclosure: I'm a DBA in my day job, so migration scripts that
are...um...broken are a pet peeve. I see a LOT of 'em! *grin*)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to