title: Why does my database get reset after each deployment?
body: <p>I am new to deploying to aws as well as flask. Basically I have a simple Flask app but every time I make a change and deploy the new code to aws elastic beanstalk, the db gets reset. </p>
  
  <pre><code>from dateutil import parser
  from datetime import datetime
  from flask import Flask, request, jsonify
  from flask_sqlalchemy import SQLAlchemy
  from flask_marshmallow import Marshmallow
  from flask_cors import CORS
  import os
  
  application = app = Flask(__name__)
  basedir = os.path.abspath(os.path.dirname(__file__))
  
  app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'db.sqlite')
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
  db = SQLAlchemy(app)
  ma = Marshmallow(app)
  cors = CORS(app)
  
  @app.route('/')
  def hello():
      return 'hello'
  
  .
  .
  .
  
  
  class User(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.String)
      weight = db.Column(db.Float)
      workouts = db.relationship('Workout', backref='user', lazy=True)
  
      def __init__(self, name, weight):
          self.name = name
          self.weight = weight
  
  class UserSchema(ma.Schema):
      class Meta:
          fields = ('id', 'name', 'weight')
  
  user_schema = UserSchema(strict=True)
  users_schema = UserSchema(many=True, strict=True)
  .
  .
  .
  
  
  db.create_all()
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>I expect that each time I
  <code>eb deploy flask-env</code> my db wouldnt get reset but it does. For instance if i create a user and then later change something in the code and deploy, that user is gone.</p>