Changes between Version 154 and Version 155 of RemovingTheMagic


Ignore:
Timestamp:
Jun 6, 2006, 10:11:25 AM (18 years ago)
Author:
Rajesh Dhawan <rajesh.dhawan@…>
Comment:

Suggested fix for auth_permissions.package problem in SQLite

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v154 v155  
    273273UPDATE django_content_type SET name='group' WHERE model='groups';
    274274UPDATE django_content_type SET name='user' WHERE model='users';
     275}}}
     276
     277=== SQLite: Drop Auth_permission.Package column ===
     278
     279'''User 'Rajesh Dhawan' notes that, in SQLite, the Foreign Key reference on column {{{package}}} from the {{{auth_permissions}}} table still causes problems after following all the above database conversions. Executing the following conversion routine eliminates the {{{package}}} column (SQLite doesn't support dropping of columns):'''
     280
     281{{{
     282CREATE TABLE "auth_permission_new" (
     283    "id" integer NOT NULL PRIMARY KEY,
     284    "name" varchar(50) NOT NULL,
     285    "content_type_id" integer,
     286    "codename" varchar(100) NOT NULL,
     287    UNIQUE ("content_type_id", "codename")
     288);
     289
     290
     291insert into auth_permission_new
     292(id, name, codename)
     293select id, name, codename
     294from auth_permission;
     295
     296alter table auth_permission rename to auth_permission_old;
     297alter table auth_permission_new rename to auth_permission;
     298
     299drop table auth_permission_old;
    275300}}}
    276301
Back to Top