Permalink
Browse files

Merge branch 'release/0.2.6'

  • Loading branch information...
klen committed Jul 15, 2012
2 parents f036f1f + e7571de commit 65494dce0e55f7f54a4991c4a68c9c0de0680852
Showing with 19 additions and 4 deletions.
  1. +2 −2 Changelog
  2. +1 −1 base/__init__.py
  3. +1 −1 base/migrations/0001_initial_data.py
  4. +15 −0 base/script.py
View
@@ -1,7 +1,7 @@
2012-07-15 klen
- * Version 0.2.5
- * Added wsgi file.
+ * Version 0.2.6
+ * Added wsgi file
2012-07-14 klen
View
@@ -1 +1 @@
-__version__ = "0.2.5"
+__version__ = "0.2.6"
@@ -4,7 +4,7 @@
class Migration(BaseMigration):
def up(self):
- from base.app import db
+ from base.ext import db
from base.users.models import Role, User
admin = Role(name='admin')
View
@@ -7,15 +7,30 @@ class CreateDB(Command):
def run(self):
from base.ext import db
db.create_all()
+
+ # Evolution support
+ from flask import current_app
+ from flask.ext.evolution import db as evolution_db
+ evolution_db.init_app(current_app)
+ evolution_db.create_all()
+
print "Database created successfuly"
class DropDB(Command):
" Drops all database tables. "
def run(self):
from base.ext import db
+
if prompt_bool("Are you sure? You will lose all your data!"):
db.drop_all()
+
+ # Evolution support
+ from flask import current_app
+ from flask.ext.evolution import db as evolution_db
+ evolution_db.init_app(current_app)
+ evolution_db.drop_all()
+
print "Database clearing"

0 comments on commit 65494dc

Please sign in to comment.