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 84925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:00:30+00:00 2026-05-10T22:00:30+00:00

I am having a postgres production database in production (which contains a lot of

  • 0

I am having a postgres production database in production (which contains a lot of Data). now I need to modify the model of the tg-app to add couple of new tables to the database.

How do i do this? I am using sqlAlchemy.

  • 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. 2026-05-10T22:00:31+00:00Added an answer on May 10, 2026 at 10:00 pm

    This always works and requires little thinking — only patience.

    1. Make a backup.

    2. Actually make a backup. Everyone skips step 1 thinking that they have a backup, but they can never find it or work with it. Don’t trust any backup that you can’t recover from.

    3. Create a new database schema.

    4. Define your new structure from the ground up in the new schema. Ideally, you’ll run a DDL script that builds the new schema. Don’t have a script to build the schema? Create one and put it under version control.

      With SA, you can define your tables and it can build your schema for you. This is ideal, since you have your schema under version control in Python.

    5. Move data.

      a. For tables which did not change structure, move data from old schema to new schema using simple INSERT/SELECT statements.

      b. For tables which did change structure, develop INSERT/SELECT scripts to move the data from old to new. Often, this can be a single SQL statement per new table. In some cases, it has to be a Python loop with two open connections.

      c. For new tables, load the data.

    6. Stop using the old schema. Start using the new schema. Find every program that used the old schema and fix the configuration.

      Don’t have a list of applications? Make one. Seriously — it’s important.

      Applications have hard-coded DB configurations? Fix that, too, while you’re at it. Either create a common config file, or use some common environment variable or something to (a) assure consistency and (b) centralize the notion of ‘production’.

    You can do this kind of procedure any time you do major surgery. It never touches the old database except to extract the data.

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

Sidebar

Ask A Question

Stats

  • Questions 301k
  • Answers 301k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is no built-in mechanism, but a little creativity means… May 13, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer try to call this way: Activator.CreateInstance(Type.GetType("TypeName")); where TypeName is fully… May 13, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer edit: no a tooltip wont do because you need to… May 13, 2026 at 8:15 pm

Related Questions

I need to periodically query the event logs on a handful of servers and
Ok I followed the steps for setting up ruby and rails on my Vista
We're considering using SSIS to maintain a PostgreSql data warehouse. I've used it before
I'm trying to bind a list of integers into an SQLTemplate IN clause like

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.