Giter VIP home page Giter VIP logo

Comments (9)

thieman avatar thieman commented on June 19, 2024

Sorry, I really should have documented this when I did it the first time. I think we can fix this by changing script_location to just be migrations in alembic.ini, but it should work in its current form if you go to the top of the Dagobah directory and do this:

alembic -c dagobah/backend/alembic.ini <command>

from dagobah.

utsengar avatar utsengar commented on June 19, 2024

Thanks, that worked.

I have added a field "hosts" to dagobah. So I generated the revision file:
alembic -c dagobah/backend/alembic.ini revision -m "add remote host"
And it created a file: dagobah/backend/migrations/versions/23f13ad15934_add_remote_host.py

What should I add in def upgrade(): and def downgrade(): functions?

And I assume I don't need to add a migration for the new table "Host" since its not a change in an existing table, right?

from dagobah.

thieman avatar thieman commented on June 19, 2024

Check out the existing migration here for an idea of what to do: https://github.com/tthieman/dagobah/blob/master/dagobah/backend/migrations/versions/2ab7af991b87_v0_2.py

Search for "Create a Migration Script" on this page for an idea of how to handle adding and removing an entire table during a migration. It might be able to automate some of that script for you through the discovery process, as well. https://alembic.readthedocs.org/en/latest/tutorial.html

edit: Try this https://alembic.readthedocs.org/en/latest/tutorial.html#auto-generating-migrations

from dagobah.

Deepakdubey90 avatar Deepakdubey90 commented on June 19, 2024

hey guys, I'm getting problem in flask, while trying to migrate that on heroku.
heroku run python manage.py db init


Creating directory /app/migrations ... done
Creating directory /app/migrations/versions ... done
Generating /app/migrations/env.py ... done
Generating /app/migrations/alembic.ini ... done
Generating /app/migrations/env.pyc ... done
Generating /app/migrations/script.py.mako ... done
Generating /app/migrations/README ... done
Please edit configuration/connection/logging settings in '/app/migrations/alembic.ini' before

proceeding.


But when I tried to migrate it, I got error like ...
*heroku run python manage.py db migrate *

///////////////////////////////////////////

Traceback (most recent call last):
File "manage.py", line 14, in
manager.run()
File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/init.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/init.py", line 383, in handle
res = handle(_args, *_config)
File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/commands.py", line 216, in call
return self.run(_args, *_kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/flask_migrate/init.py", line 171, in migrate
version_path=version_path, rev_id=rev_id)
File "/app/.heroku/python/lib/python2.7/site-packages/alembic/command.py", line 74, in revision
script_directory = ScriptDirectory.from_config(config)
File "/app/.heroku/python/lib/python2.7/site-packages/alembic/script/base.py", line 120, in from_config
version_locations=version_locations
File "/app/.heroku/python/lib/python2.7/site-packages/alembic/script/base.py", line 57, in init
"scripts folder." % dir)
alembic.util.CommandError: Path doesn't exist: 'migrations'. Please use the 'init' command to create a new scripts folder.

/////////////////////////////////////////////////////////////////////////////////////////////////
any idea, to fixed this problem
I'm trying to build an registration app using technology.

  1. Flask
  2. Postgresql
  3. SqlAlchemy

from dagobah.

thieman avatar thieman commented on June 19, 2024

@Deepakdubey90 You would probably have better luck with your question on Stack Overflow or in Alembic's issue tracker. Your question doesn't seem to be related to Dagobah.

from dagobah.

yusank avatar yusank commented on June 19, 2024

@Deepakdubey90 i have some problem ,and i don`t know how to fix ,did you have fix this problem anyway???

from dagobah.

Deepakdubey90 avatar Deepakdubey90 commented on June 19, 2024

@yusank , Yes I have fixed that.

from dagobah.

Colbert337 avatar Colbert337 commented on June 19, 2024

@Deepakdubey90 hello,how to fix this problem ?i face the same problem,thx!

version_locations=version_locations
File "/app/.heroku/python/lib/python2.7/site-packages/alembic/script/base.py", line 57, in init
"scripts folder." % dir)
alembic.util.CommandError: Path doesn't exist: 'migrations'. Please use the 'init' command to create a new scripts folder.

from dagobah.

kovacicek avatar kovacicek commented on June 19, 2024

@Deepakdubey90 how did you fixed the problem? I am facing the same issue!

from dagobah.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.