PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 13, 2022

[FIXED] How to clear history and run all migrations from the beginning?

 April 13, 2022     alembic, migration, python     No comments   

Issue

How I can clear history using alembic? I couldn't find this option in alembic history. I want to run from the first migration rather than the last applied.


Solution

If you want to start with a fresh database, just drop the database, create a new one, then run the migrations. For example, with PostgreSQL:

$ dropdb my_db
$ createdb my_db
$ alembic upgrade head

Now you have a blank database with all the migrations applied.



Answered By - davidism
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing