changeset 21:5a036517a96b

Make flask-sqlalchemy work with alembic
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sun, 02 Jun 2013 12:08:22 +0200
parents 44d561c15361
children 25cc6207b03e
files alembic.ini alembic/env.py
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/alembic.ini	Sun Jun 02 11:58:30 2013 +0200
+++ b/alembic.ini	Sun Jun 02 12:08:22 2013 +0200
@@ -11,7 +11,8 @@
 # the 'revision' command, regardless of autogenerate
 # revision_environment = false
 
-sqlalchemy.url = postgresql+psycopg2://postgres@localhost/partybuddy
+sqlalchemy.url = sqlite:////tmp/partybuddy.db
+#postgresql+psycopg2://postgres@localhost/partybuddy
 
 
 # Logging configuration
--- a/alembic/env.py	Sun Jun 02 11:58:30 2013 +0200
+++ b/alembic/env.py	Sun Jun 02 12:08:22 2013 +0200
@@ -15,10 +15,8 @@
 # for 'autogenerate' support
 # from myapp import mymodel
 # target_metadata = mymodel.Base.metadata
-import os, sys
-sys.path.append(os.getcwd())
-from server.database import Base
-target_metadata = Base.metadata
+from server import db
+target_metadata = db.metadata
 
 # other values from the config, defined by the needs of env.py,
 # can be acquired: