You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LOCAL_DEVELOPMENT.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ bun run local
32
32
#### What the script does:
33
33
1.**Starts Postgres**: Launches the `db` container.
34
34
2.**Installs Extensions**: Pre-installs `pgcrypto`, `uuid-ossp`, and `pg_stat_statements` into the `public` schema.
35
-
3.**Loads Local Seed**: If `public` has no tables, the script loads `seed/dump.sql` into the DB. This is the default and recommended local flow.
35
+
3.**Loads Local Seed**: The script will attempt to load `seed/dump.sql` into the DB only when there are no existing user tables present in the database. If the database already contains tables (non-system tables), the seed step will be skipped to avoid accidentally overwriting existing data. This is the default and recommended local flow.
36
36
4.**Starts the API**: Launches the `api` container and waits for it to be healthy.
info "Checking whether database already has user tables..."
118
+
TABLE_COUNT=$(docker compose exec -T db psql -U postgres -d coc -t -A -c "SELECT count(*) FROM pg_catalog.pg_tables WHERE schemaname NOT IN ('pg_catalog','information_schema');"| tr -d '[:space:]'|| true)
119
+
120
+
if [[ -z"$TABLE_COUNT" ]];then
121
+
warn "Could not determine table count; proceeding with seed."
0 commit comments