room-planner: seed auth DB via psql on LXC 100, not docker run
The docker run approach failed (image tag/context issues); use the same direct-psql pattern as add-app.sh which is proven reliable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
988b8390f2
commit
7e317e9d4e
1 changed files with 23 additions and 7 deletions
|
|
@ -1130,15 +1130,31 @@ ${build_out}"
|
|||
&& msg_ok "Room Planner running at 10.10.10.120:3080" \
|
||||
|| msg_warn "Room Planner may need extra time — check LXC 120"
|
||||
|
||||
# Seed app + capabilities into auth DB
|
||||
# Seed app + capabilities into auth DB (psql on LXC 100 — same pattern as add-app.sh)
|
||||
msg_info "Seeding room-planner into auth DB"
|
||||
pct exec 120 -- docker run --rm \
|
||||
-e DATABASE_URL="postgresql://auth:${AUTH_DB_PASS}@10.10.10.100:5432/auth_db" \
|
||||
-v /opt/room-planner/seed-app.js:/app/seed-app.js \
|
||||
room-planner-backend \
|
||||
node seed-app.js &>/dev/null \
|
||||
pct exec 100 -- docker exec hotel-manage-postgres psql -U postgres -d auth_db -c "
|
||||
INSERT INTO apps (slug, name, description, base_path, icon, theme_color, category, internal_host, internal_port)
|
||||
VALUES ('room-planner', 'Room Planner', 'Daily housekeeping room view with NewBook task management', '/room-planner', 'BedDouble', '#2d6a4f', 'Housekeeping', '10.10.10.120', 3080)
|
||||
ON CONFLICT (slug) DO UPDATE SET
|
||||
name=EXCLUDED.name, description=EXCLUDED.description, base_path=EXCLUDED.base_path,
|
||||
icon=EXCLUDED.icon, theme_color=EXCLUDED.theme_color, category=EXCLUDED.category,
|
||||
internal_host=EXCLUDED.internal_host, internal_port=EXCLUDED.internal_port;
|
||||
INSERT INTO app_capabilities (app_id, slug, name, description, sort_order)
|
||||
SELECT a.id, c.slug, c.name, c.description, c.sort_order
|
||||
FROM apps a, (VALUES
|
||||
('view','View Planner','Access the room planner view',1),
|
||||
('guest_details','Guest Details','View guest names and personal information',2),
|
||||
('rate_details','Rate Details','View pricing and rate plan information',3),
|
||||
('view_all_notes','View All Notes','View all booking note types',4),
|
||||
('complete_tasks','Complete Tasks','Mark NewBook tasks as complete',5),
|
||||
('update_status','Update Room Status','Mark rooms clean, dirty or inspected',6),
|
||||
('settings','Settings','Configure room planner settings',7)
|
||||
) AS c(slug, name, description, sort_order)
|
||||
WHERE a.slug = 'room-planner'
|
||||
ON CONFLICT (app_id, slug) DO NOTHING;
|
||||
" &>/dev/null \
|
||||
&& msg_ok "room-planner seeded into auth DB" \
|
||||
|| msg_warn "Seed failed — run manually: see seed-app.js"
|
||||
|| msg_warn "Seed failed — run the SQL in room-planner/seed-app.js manually via psql on LXC 100"
|
||||
|
||||
# Add /room-planner/ location to NPM proxy host
|
||||
npm_add_location "/room-planner/" "10.10.10.120" 3080
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue