448 | | == Database table-name changes == |
449 | | |
450 | | Renamed {{{core_sessions}}} table to {{{django_sessions}}}. To change, execute this SQL in your database: |
451 | | |
452 | | {{{ |
453 | | ALTER TABLE core_sessions RENAME TO django_sessions; |
454 | | }}} |
| 448 | == Renamed core database tables == |
| 449 | |
| 450 | '''Status: Done''' |
| 451 | |
| 452 | Renamed a bunch of the code Django tables. To upgrade, execute this SQL in your database: |
| 453 | |
| 454 | {{{ |
| 455 | ALTER TABLE auth_groups RENAME TO auth_group; |
| 456 | ALTER TABLE auth_groups_permissions RENAME TO auth_group_permissions; |
| 457 | ALTER TABLE auth_messages RENAME TO auth_message; |
| 458 | ALTER TABLE auth_permissions RENAME TO auth_permission; |
| 459 | ALTER TABLE auth_users RENAME TO auth_user; |
| 460 | ALTER TABLE auth_users_groups RENAME TO auth_user_groups; |
| 461 | ALTER TABLE auth_users_user_permissions RENAME TO auth_user_user_permissions; |
| 462 | ALTER TABLE content_types RENAME TO django_content_type; |
| 463 | ALTER TABLE core_sessions RENAME TO django_session; |
| 464 | ALTER TABLE django_flatpages RENAME TO django_flatpage; |
| 465 | ALTER TABLE django_flatpages_sites RENAME TO django_flatpage_sites; |
| 466 | ALTER TABLE django_redirects RENAME TO django_redirect; |
| 467 | ALTER TABLE packages RENAME TO django_package; |
| 468 | ALTER TABLE sites RENAME TO django_site; |
| 469 | }}} |
| 470 | |
| 471 | == Changed database table naming scheme == |
| 472 | |
| 473 | Database table names formerly were created by joining the app_label and module_name. Example: {{{polls_polls}}}. |
| 474 | |
| 475 | Because there's no longer any pluralization, database table names are now formed by joining the app_label and model name (singular). Example: {{{polls_poll}}}. |
| 476 | |
| 477 | As always, this behavior can be overridden on a per-model basis by specifying the {{{db_table}}} attribute in {{{class Meta}}} in your model. |
| 478 | |
| 479 | To upgrade, you'll either have to explicitly set {{{db_table}}} in your models or rename your database tables to fit the new naming scheme Django expects. |