Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=db
- MODE=${MODE}
- AUTHENTIK_DISABLE_AUTHENTICATION=${AUTHENTIK_DISABLE_AUTHENTICATION}
ports:
- 8000:8000
depends_on:
Expand Down
29 changes: 29 additions & 0 deletions transfers/seed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from db.thing import Thing
from db.engine import session_ctx


def seed():
"""Create a single contact, location, and water well."""
with session_ctx() as session:
# Create a water well
water_well = Thing(
name="TEST-0001",
thing_type="water well",
release_status="draft",
first_visit_date="2023-03-03",
well_depth=100.0,
hole_depth=100.0,
well_construction_notes="Seed well construction notes",
well_casing_diameter=5.0,
well_casing_depth=10.0,
)
session.add(water_well)
session.commit()
session.refresh(water_well)
print(f"Created water well: {water_well.id} - {water_well.name}")


if __name__ == "__main__":
seed()

# ============= EOF =============================================
Loading