Changes between Version 152 and Version 153 of RemovingTheMagic


Ignore:
Timestamp:
05/30/06 09:46:26 (9 years ago)
Author:
adrian
Comment:

Added "Changes to the SQL for the comments app" section

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v152 v153  
    211211}}}
    212212
     213=== Changes to the SQL for the comments app ===
     214
     215The comments app, still undocumented, also requires some database changes.
     216
     217In PostgreSQL:
     218{{{
     219BEGIN;
     220ALTER TABLE comments RENAME TO comments_comment;
     221ALTER TABLE comments_id_seq RENAME TO comments_comment_id_seq;
     222
     223ALTER TABLE comments_karma RENAME TO comments_karmascore;
     224ALTER TABLE comments_karma_id_seq RENAME TO comments_karmascore_id_seq;
     225
     226ALTER TABLE comments_free RENAME TO comments_freecomment;
     227ALTER TABLE comments_free_id_seq RENAME TO comments_freecomment_id_seq;
     228
     229ALTER TABLE comments_moderator_deletions RENAME TO comments_moderatordeletion;
     230ALTER TABLE comments_moderator_deletions_id_seq RENAME TO comments_moderatordeletion_id_seq;
     231
     232ALTER TABLE comments_user_flags RENAME TO comments_userflag;
     233ALTER TABLE comments_user_flags_id_seq RENAME TO comments_userflag_id_seq;
     234
     235COMMIT;
     236}}}
     237
     238In other databases:
     239{{{
     240ALTER TABLE comments RENAME TO comments_comment;
     241ALTER TABLE comments_karma RENAME TO comments_karmascore;
     242ALTER TABLE comments_free RENAME TO comments_freecomment;
     243ALTER TABLE comments_moderator_deletions RENAME TO comments_moderatordeletion;
     244ALTER TABLE comments_user_flags RENAME TO comments_userflag;
     245}}}
     246
    213247=== Auth_permissions case changes ===
    214248
     
    240274UPDATE django_content_type SET name='user' WHERE model='users';
    241275}}}
    242 
    243 '''User 'garthk' also found some problem with the {{{.module}}}/{{{.model}}} renaming stuff above, which he fixed manually, and followed up with some fixes for the Django comments system in case you're getting exceptions telling you that "Table appname.comments_comment does not exist".'''
    244 
    245 {{{
    246 ALTER TABLE comments RENAME TO comments_comment;
    247 ALTER TABLE comments_karma RENAME TO comments_karmascore;
    248 ALTER TABLE comments_free RENAME TO comments_freecomment;
    249 ALTER TABLE comments_moderator_deletions RENAME TO comments_moderatordeletion;
    250 ALTER TABLE comments_user_flags RENAME TO comments_userflag;
    251 }}}
    252 
    253276
    254277=== Database table-naming scheme has been changed ===
Back to Top