76 lines
2.6 KiB
SQL
76 lines
2.6 KiB
SQL
--======================================================================
|
|
-- Homarr Board Import SQL
|
|
-- Run this in the Homarr SQLite database to create all boards
|
|
-- Location: /opt/homarr/appdata/db/homarr.db
|
|
--======================================================================
|
|
|
|
-- WARNING: This is a template. Homarr 1.0 schema may vary.
|
|
-- Use with caution and backup first!
|
|
|
|
-- Backup current database first:
|
|
-- cp /opt/homarr/appdata/db/homarr.db /opt/homarr/appdata/db/homarr.db.backup.$(date +%Y%m%d)
|
|
|
|
--======================================================================
|
|
-- NOTE: Homarr 1.0 uses Prisma ORM with relational tables.
|
|
-- The exact table structure depends on your version.
|
|
-- Check current schema with: .schema
|
|
--======================================================================
|
|
|
|
-- This is a conceptual example - actual table names may differ.
|
|
-- You'll need to inspect the actual database schema first.
|
|
|
|
-- To inspect your database:
|
|
-- docker exec -it homarr sh
|
|
-- apk add sqlite3
|
|
-- sqlite3 /appdata/db/homarr.db
|
|
-- .tables
|
|
-- .schema Board
|
|
-- .schema Section
|
|
|
|
--======================================================================
|
|
-- ALTERNATIVE: Manual API approach
|
|
--======================================================================
|
|
|
|
-- Since SQL direct insert is risky, here's the recommended approach:
|
|
-- Use Homarr's internal API with proper authentication
|
|
|
|
-- 1. Get your session cookie from browser DevTools
|
|
-- 2. Use curl to create boards
|
|
|
|
-- Example curl command structure (you need to adapt):
|
|
/*
|
|
curl -X POST http://localhost:7575/api/boards \
|
|
-H "Content-Type: application/json" \
|
|
-H "Cookie: your-session-cookie-here" \
|
|
-d '{
|
|
"name": "Main Dashboard",
|
|
"visibility": "public"
|
|
}'
|
|
*/
|
|
|
|
--======================================================================
|
|
-- FOR NOW: Manual Setup is Recommended
|
|
--======================================================================
|
|
|
|
-- The JSON files in this folder show you exactly what to create.
|
|
-- Follow the step-by-step guide in IMPORT_JSON.md
|
|
|
|
-- Or wait for Homarr to add official JSON import feature!
|
|
|
|
--======================================================================
|
|
-- If you want to try SQL anyway, first explore the schema:
|
|
--======================================================================
|
|
|
|
-- List all tables
|
|
-- SELECT name FROM sqlite_master WHERE type='table';
|
|
|
|
-- Show Board table schema
|
|
-- PRAGMA table_info(Board);
|
|
|
|
-- Show current boards
|
|
-- SELECT * FROM Board;
|
|
|
|
--======================================================================
|
|
-- END OF FILE
|
|
--======================================================================
|