Refactor czi_hosted and server into backend directory, pull common code into backend/common, refactor tests (#2102)

* move local_server -> backend/server server-> backend/czi_hosted, pull common code into backend/common update imports, tests and make commands
This commit is contained in:
Madison Dunitz
2021-03-26 00:27:07 -05:00
committed by GitHub
parent e6e358ddc8
commit 78c9d24ed4
425 changed files with 734 additions and 5317 deletions
+18
View File
@@ -0,0 +1,18 @@
"""
Drops and recreates all tables for local testing according to cellxgene_orm.py
"""
from sqlalchemy import create_engine
from backend.czi_hosted.db.cellxgene_orm import Base
def create_db(database_uri: str = "postgresql://postgres:test_pw@localhost:5432"):
engine = create_engine(database_uri)
print("Dropping tables")
Base.metadata.drop_all(engine)
print("Recreating tables")
Base.metadata.create_all(engine)
if __name__ == "__main__":
create_db()