fix a bug in model definition, and use Flask-Script to do some manage work