Closed oussjarrousse closed 3 years ago
it seems that the line db.engine.execute('CREATE EXTENSION if not exists pg_trgm ;')
is the cause of the issue as it does not check if the current engine is set to postgres
@click.command()
@with_appcontext
def create_db():
"""creates db tables - import your models within commands.py to create the models.
"""
db.engine.execute('CREATE EXTENSION if not exists pg_trgm ;')
print('Trigram extension installed successfully')
db.create_all()
print('Database structure created successfully')
# possible optimization: SET enable_seqscan = off;
if Bayanat does not support sqlite3 then I suggest removing the following line from enferno/settings.py
# SQLALCHEMY_DATABASE_URI = 'sqlite:////home/bayanat/bayanat/enferno.db'
as it suggests otherwise.
Bayanat is designed to work with postgres and doesn't support sqlite. We've removed this line from the settings file.
the "
flask create-db
" command is producing the following error message whenSQLALCHEMY_DATABASE_URI = 'sqlite:////home/bayanat/bayanat/enferno.db'