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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:49:37+00:00 2026-06-09T03:49:37+00:00

I have added a new field to my models .From django manage.py how can

  • 0

I have added a new field to my models .From django manage.py how can i print the migration(alter table statement).In the following is_tag is my new field

When i do sqlall i get the following output.How can i get the alter table commands

 root@rajeev-laptop:/opt/labs/labs_site# python manage.py sqlall content
 BEGIN;
 CREATE TABLE `content_content` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`name` varchar(255) NOT NULL,
`uploaded_by_id` integer NOT NULL,
`is_local` integer NOT NULL,
`access` integer NOT NULL,
`fq_name` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`is_tag` bool NOT NULL,
`timestamp` datetime NOT NULL
 )
 ;
    ALTER TABLE `content_content` ADD CONSTRAINT `uploaded_by_id_refs_id_4f9cfefd` FOREIGN KEY (`uploaded_by_id`) REFERENCES `users_userprofile` (`id`);
   CREATE INDEX `content_content_1bc5ce19` ON `content_content` (`uploaded_by_id`);
 COMMIT;
  • 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-09T03:49:39+00:00Added an answer on June 9, 2026 at 3:49 am

    syncdb will never alter tables, or in the docs own words:

    syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation. Changes to model classes and database schemas often involve some form of ambiguity and, in those cases, Django would have to guess at the correct changes to make. There is a risk that critical data would be lost in the process.

    To manage migrations, you should use South

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

Sidebar

Related Questions

Most of my content is in a new table I have added to JOOMLA
I have one model User with Devise gem. I added a new field called
My storyboard seems locked. I have added new labels and imageviews to two different
I have added a new job in my hudson server which builds the project
I have IIS 7.5 With one web site I added new virtual directory and
I have a list within Sharepoint, using a custom new form I have added
We recently added a new TeamCity build agent. Because it doesn't have ASP.NET MVC
I have download the new Bing API C# file and added it to my
I am new to iphone development.I have created a UIview controller class and added
I need to have a new view(w/ ViewController) added over the top of another.

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.