Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:13:38+00:00 2026-06-07T21:13:38+00:00

I made the stupid mistake of creating too many models in the same Django

  • 0

I made the stupid mistake of creating too many models in the same Django app, now I want to split it into 3 distinct ones. Problem is: there’s already data in production in two customers’ sites, so I need to carefully plan any schema/data migration to be done (I’m using django-south). I’m unsure on how to proceed, any advice would be greatly appreciated.

(I’m using PostgreSQL on a Ubuntu server 12.4 LTS, if that’s of any relevance)

I thought about using db.rename_table, but can’t figure out how to correctly update the foreign keys to those models (old to new) – irrelevant at the database level (since the table renaming already got that covered), but not so at the ORM level.

Update: after thinking about it, and after asking this question on programmmers.SE, I decided to keep things simple and don’t worry about migrations between major versions of the product. Short term, I’ll just use db.rename_table to match the new name, while also using db_table as Daniel Roseman suggested, all the while keeping the models in the old app. When upgrading to a major version, I swith to the new app and ditch all migrations altogether (so fresh installs of the new version will create the database “as-is” instead of going through all historical migrations).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:13:40+00:00Added an answer on June 7, 2026 at 9:13 pm

    I don’t see why you need any data migration at all.

    Just move the models to the new app, and add a db_table setting in the inner Meta classes to point to the old table names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made a pretty stupid mistake with a git repository and lost some files
I made a stupid mistake by upgrading my SDK version to r15 as the
EDIT: Solved it! I made stupid mistake, I had a textureId I'd forgotten about
I know its kinda embarrassing 'cause I made a very stupid mistake by manually
------------------NOTICE---------------- Sorry guys, made a stupid mistake, I had found this fix already: https://devforums.apple.com/message/32282
I'm pretty new to python so it's prolly a stupid mistake i made. I'm
I made an iphone app to capture image from camera and to set that
I made a mistake and entered: SELECT * FROM table LIMIT1 instead of SELECT
I am creating an email response to an overnight build, I want to get
Ive made a stupid error in a production system. I chose JOINED strategy instead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.