mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-04-05 20:01:32 +00:00
Update bootstrap_db.sh
This commit is contained in:
@@ -1,20 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
echo "it works"
|
||||||
|
|
||||||
echo "Waiting for PostgreSQL to be ready..."
|
|
||||||
until psql -h "$DB_HOST" -U "$DB_USER" -d "$DB_NAME" -c '\q' 2>/dev/null; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Creating test table..."
|
|
||||||
psql -h "$DB_HOST" -U "$DB_USER" -d "$DB_NAME" <<SQL
|
|
||||||
CREATE TABLE IF NOT EXISTS test_table (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
name VARCHAR(100) NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO test_table (name) VALUES ('hello from bootstrap');
|
|
||||||
SQL
|
|
||||||
|
|
||||||
echo "Bootstrap complete!"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user