Importing models to create database
This commit is contained in:
		@@ -21,6 +21,7 @@ def install_scripts():
 | 
				
			|||||||
    if not database_exists(Config.SQLALCHEMY_DATABASE_URI):       
 | 
					    if not database_exists(Config.SQLALCHEMY_DATABASE_URI):       
 | 
				
			||||||
        create_database(Config.SQLALCHEMY_DATABASE_URI)
 | 
					        create_database(Config.SQLALCHEMY_DATABASE_URI)
 | 
				
			||||||
        write('system.log', 'No database found. Creating a new database.')
 | 
					        write('system.log', 'No database found. Creating a new database.')
 | 
				
			||||||
 | 
					        from .models import Entry, Test, User
 | 
				
			||||||
        with app.app_context(): db.create_all()
 | 
					        with app.app_context(): db.create_all()
 | 
				
			||||||
        write('system.log', 'Creating database schema.')
 | 
					        write('system.log', 'Creating database schema.')
 | 
				
			||||||
    if not path.isfile(f'./{data}/.encryption.key'):
 | 
					    if not path.isfile(f'./{data}/.encryption.key'):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user