From ba3c470b5ce19f05b14122a7c9d79a95498a5396 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Nov 2025 00:24:01 +0000 Subject: [PATCH] feat(db): add default plugin and template repositories Add hardcoded default repositories to database initialization: - Official Plugins: https://github.com/JoshuaAFerguson/streamspace-plugins - Official Templates: https://github.com/JoshuaAFerguson/streamspace-templates This ensures that the StreamSpace platform has default repositories configured on first initialization, allowing users to immediately access the official plugin and template catalogs without manual configuration. The INSERT uses ON CONFLICT DO NOTHING for idempotency, so it won't fail on subsequent database initializations. --- api/internal/db/database.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/internal/db/database.go b/api/internal/db/database.go index 4bce669e..d3dc628e 100644 --- a/api/internal/db/database.go +++ b/api/internal/db/database.go @@ -378,6 +378,12 @@ func (d *Database) Migrate() error { updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )`, + // Insert default repositories (plugins and templates) + `INSERT INTO repositories (name, url, branch, auth_type, status) VALUES + ('Official Plugins', 'https://github.com/JoshuaAFerguson/streamspace-plugins', 'main', 'none', 'active'), + ('Official Templates', 'https://github.com/JoshuaAFerguson/streamspace-templates', 'main', 'none', 'active') + ON CONFLICT (name) DO NOTHING`, + // Catalog templates (cache of templates from repos) `CREATE TABLE IF NOT EXISTS catalog_templates ( id SERIAL PRIMARY KEY,