From 53fff625ac1aca6f5e65f63b94d84a3c56a0f78c Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Thu, 29 Jan 2026 13:11:18 -0600 Subject: [PATCH] Fix migrations to remove is_public and allow_public_internet from schema - Update migration 017 to not include is_public column or index - Update migration 018 to not include allow_public_internet column - Make migration 020 a no-op (public sources no longer seeded) --- backend/app/database.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/backend/app/database.py b/backend/app/database.py index ba84a94..8533884 100644 --- a/backend/app/database.py +++ b/backend/app/database.py @@ -462,7 +462,6 @@ def _run_migrations(): source_type VARCHAR(50) NOT NULL DEFAULT 'generic', url VARCHAR(2048) NOT NULL, enabled BOOLEAN NOT NULL DEFAULT FALSE, - is_public BOOLEAN NOT NULL DEFAULT TRUE, auth_type VARCHAR(20) NOT NULL DEFAULT 'none', username VARCHAR(255), password_encrypted BYTEA, @@ -480,7 +479,6 @@ def _run_migrations(): ); CREATE INDEX IF NOT EXISTS idx_upstream_sources_enabled ON upstream_sources(enabled); CREATE INDEX IF NOT EXISTS idx_upstream_sources_source_type ON upstream_sources(source_type); - CREATE INDEX IF NOT EXISTS idx_upstream_sources_is_public ON upstream_sources(is_public); CREATE INDEX IF NOT EXISTS idx_upstream_sources_priority ON upstream_sources(priority); """, ), @@ -489,14 +487,13 @@ def _run_migrations(): sql=""" CREATE TABLE IF NOT EXISTS cache_settings ( id INTEGER PRIMARY KEY DEFAULT 1, - allow_public_internet BOOLEAN NOT NULL DEFAULT TRUE, auto_create_system_projects BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), CONSTRAINT check_cache_settings_singleton CHECK (id = 1) ); - INSERT INTO cache_settings (id, allow_public_internet, auto_create_system_projects) - VALUES (1, TRUE, TRUE) + INSERT INTO cache_settings (id, auto_create_system_projects) + VALUES (1, TRUE) ON CONFLICT (id) DO NOTHING; """, ), @@ -522,13 +519,10 @@ def _run_migrations(): Migration( name="020_seed_default_upstream_sources", sql=""" - INSERT INTO upstream_sources (id, name, source_type, url, enabled, is_public, auth_type, priority) - VALUES - (gen_random_uuid(), 'npm-public', 'npm', 'https://registry.npmjs.org', FALSE, TRUE, 'none', 100), - (gen_random_uuid(), 'pypi-public', 'pypi', 'https://pypi.org/simple', FALSE, TRUE, 'none', 100), - (gen_random_uuid(), 'maven-central', 'maven', 'https://repo1.maven.org/maven2', FALSE, TRUE, 'none', 100), - (gen_random_uuid(), 'docker-hub', 'docker', 'https://registry-1.docker.io', FALSE, TRUE, 'none', 100) - ON CONFLICT (name) DO NOTHING; + -- Originally seeded public sources, but these are no longer used. + -- Migration 023 deletes any previously seeded sources. + -- This migration is now a no-op for fresh installs. + SELECT 1; """, ), Migration(