Skip to content

CEPHAL0/AgriMarket-Nepal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Branch Naming

username/branchPurpose

Eg: sharad/AddMigrationFiles

Scripts

Activate venv

source venv/Srcipts/activate

Add Requirements to requirements.txt

pip freeze>requirements.txt

Generate Migration Files automatically

alembic revision --autogenerate  -m "<migration_file_name>"

Run migrations

alembic upgrade head

Roll back migrations to initial state

alembic downgrade base

Roll back migration to certain state: (For example, if you want to downgrade 00fc then you have to use alembic downgrade <version before 00fc>)

alembic downgrade <versionNumber>

Run backend

uvicorn main:app --host <host> --port <portnumber> --reload

Remove all of the __pycache__ folders

find -type d -name __pycache__ -exec rm -rf {} +

Migration Guide

Run the following commands initially

alembic revision --autogenerate -m "Inital Setup"

Before doing some changes, you can delete the alembic_versions and other tables before generating migration files again

Postgresql url format:DATABASE_URI = 'postgresql://postgres:<password>@localhost/<name_of_the_datbase>'

Utility Commands

  1. Change Directory to server, activate python environment and remove all pycache server

    source backend.sh
  2. Remove all pycache folder (you need to be inside server folder to execute this)

    source remove_pycache.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •