Changes between Version 151 and Version 152 of RemovingTheMagic


Ignore:
Timestamp:
May 30, 2006, 9:23:23 AM (18 years ago)
Author:
Adrian Holovaty
Comment:

Updated PostgreSQL migration SQL to work for Postgres 7.x

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v151 v152  
    186186
    187187ALTER TABLE auth_permission DROP COLUMN package;
     188
     189-- First try this:
    188190ALTER TABLE django_content_type DROP CONSTRAINT "content_types_package_fkey";
    189 ALTER TABLE django_content_type RENAME COLUMN package TO app_label;
    190 ALTER TABLE django_content_type ALTER COLUMN app_label TYPE varchar(100);
     191-- If that didn't work, do this:
     192ALTER TABLE django_content_type DROP CONSTRAINT "$1";
     193
     194ALTER TABLE django_content_type ADD COLUMN app_label varchar(100);
     195UPDATE django_content_type SET app_label=package;
     196ALTER TABLE django_content_type ALTER COLUMN app_label SET NOT NULL;
     197ALTER TABLE django_content_type DROP COLUMN package;
    191198
    192199DROP TABLE packages;
Back to Top