
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from service import app, db

# db.create_all() needs all models to be imported
from service.db_access import *


migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()


from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from service import app, db

# db.create_all() needs all models to be imported explicitly (not *)
from service.db_access import User


migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()

Fix model import needed by create_all()
Fix model import needed by create_all()

  
  from flask_script import Manager
  from flask_migrate import Migrate, MigrateCommand
  
  from service import app, db
  
- # db.create_all() needs all models to be imported
+ # db.create_all() needs all models to be imported explicitly (not *)
- from service.db_access import *
+ from service.db_access import User
  
  
  migrate = Migrate(app, db)
  
  manager = Manager(app)
  manager.add_command('db', MigrateCommand)
  
  
  if __name__ == '__main__':
      manager.run()
  
Fix model import needed by create_all()
## Code Before:

from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from service import app, db

# db.create_all() needs all models to be imported
from service.db_access import *


migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()

## Instruction:
Fix model import needed by create_all()
## Code After:

from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from service import app, db

# db.create_all() needs all models to be imported explicitly (not *)
from service.db_access import User


migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
