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)
This commit is contained in:
@@ -462,7 +462,6 @@ def _run_migrations():
|
|||||||
source_type VARCHAR(50) NOT NULL DEFAULT 'generic',
|
source_type VARCHAR(50) NOT NULL DEFAULT 'generic',
|
||||||
url VARCHAR(2048) NOT NULL,
|
url VARCHAR(2048) NOT NULL,
|
||||||
enabled BOOLEAN NOT NULL DEFAULT FALSE,
|
enabled BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
is_public BOOLEAN NOT NULL DEFAULT TRUE,
|
|
||||||
auth_type VARCHAR(20) NOT NULL DEFAULT 'none',
|
auth_type VARCHAR(20) NOT NULL DEFAULT 'none',
|
||||||
username VARCHAR(255),
|
username VARCHAR(255),
|
||||||
password_encrypted BYTEA,
|
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_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_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);
|
CREATE INDEX IF NOT EXISTS idx_upstream_sources_priority ON upstream_sources(priority);
|
||||||
""",
|
""",
|
||||||
),
|
),
|
||||||
@@ -489,14 +487,13 @@ def _run_migrations():
|
|||||||
sql="""
|
sql="""
|
||||||
CREATE TABLE IF NOT EXISTS cache_settings (
|
CREATE TABLE IF NOT EXISTS cache_settings (
|
||||||
id INTEGER PRIMARY KEY DEFAULT 1,
|
id INTEGER PRIMARY KEY DEFAULT 1,
|
||||||
allow_public_internet BOOLEAN NOT NULL DEFAULT TRUE,
|
|
||||||
auto_create_system_projects BOOLEAN NOT NULL DEFAULT TRUE,
|
auto_create_system_projects BOOLEAN NOT NULL DEFAULT TRUE,
|
||||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||||
CONSTRAINT check_cache_settings_singleton CHECK (id = 1)
|
CONSTRAINT check_cache_settings_singleton CHECK (id = 1)
|
||||||
);
|
);
|
||||||
INSERT INTO cache_settings (id, allow_public_internet, auto_create_system_projects)
|
INSERT INTO cache_settings (id, auto_create_system_projects)
|
||||||
VALUES (1, TRUE, TRUE)
|
VALUES (1, TRUE)
|
||||||
ON CONFLICT (id) DO NOTHING;
|
ON CONFLICT (id) DO NOTHING;
|
||||||
""",
|
""",
|
||||||
),
|
),
|
||||||
@@ -522,13 +519,10 @@ def _run_migrations():
|
|||||||
Migration(
|
Migration(
|
||||||
name="020_seed_default_upstream_sources",
|
name="020_seed_default_upstream_sources",
|
||||||
sql="""
|
sql="""
|
||||||
INSERT INTO upstream_sources (id, name, source_type, url, enabled, is_public, auth_type, priority)
|
-- Originally seeded public sources, but these are no longer used.
|
||||||
VALUES
|
-- Migration 023 deletes any previously seeded sources.
|
||||||
(gen_random_uuid(), 'npm-public', 'npm', 'https://registry.npmjs.org', FALSE, TRUE, 'none', 100),
|
-- This migration is now a no-op for fresh installs.
|
||||||
(gen_random_uuid(), 'pypi-public', 'pypi', 'https://pypi.org/simple', FALSE, TRUE, 'none', 100),
|
SELECT 1;
|
||||||
(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;
|
|
||||||
""",
|
""",
|
||||||
),
|
),
|
||||||
Migration(
|
Migration(
|
||||||
|
|||||||
Reference in New Issue
Block a user