mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 01:48:12 +08:00
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:
@@ -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()
|
||||
Reference in New Issue
Block a user