From 4a1f39b4b8e77791a8f438dd753fe23cd2902ed1 Mon Sep 17 00:00:00 2001 From: David Pollard Date: Sat, 21 Mar 2026 14:13:37 -0700 Subject: [PATCH 1/3] Fix number of arguments to allow migrations to run --- wcoa/migrations/0030_ohidashboard_body.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcoa/migrations/0030_ohidashboard_body.py b/wcoa/migrations/0030_ohidashboard_body.py index 0d02dc7..8f1039f 100644 --- a/wcoa/migrations/0030_ohidashboard_body.py +++ b/wcoa/migrations/0030_ohidashboard_body.py @@ -15,7 +15,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='ohidashboard', name='body', - field=wagtail.fields.StreamField([('content', wagtail.blocks.RichTextBlock(required=False))], default='{"blocks":[{"key":"j9bes","text":"one","type":"ordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"e9r3j","text":"","type":"ordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}', use_json_field=True), + field=wagtail.fields.StreamField([('content', wagtail.blocks.RichTextBlock(required=False))], default=list, use_json_field=True), preserve_default=False, ), ] From 0244205281450f84946642a80edc71d714d32026 Mon Sep 17 00:00:00 2001 From: David Pollard Date: Sat, 21 Mar 2026 14:19:35 -0700 Subject: [PATCH 2/3] Add script for upgrading postgres to version 17 --- scripts/postgres_upgrade_2_17.py | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 scripts/postgres_upgrade_2_17.py diff --git a/scripts/postgres_upgrade_2_17.py b/scripts/postgres_upgrade_2_17.py new file mode 100644 index 0000000..9452ad7 --- /dev/null +++ b/scripts/postgres_upgrade_2_17.py @@ -0,0 +1,47 @@ + +#!/usr/bin/env python3 +import subprocess +import sys + +def run(cmd, check=True): + print(f"$ {cmd}") + result = subprocess.run(cmd, shell=True, check=check) + return result + +def main(): + print("==> Installing dependencies...") + run("apt install -y curl ca-certificates") + + print("\n==> Setting up PostgreSQL signing key...") + run("install -d /usr/share/postgresql-common/pgdg") + run( + "curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail " + "https://www.postgresql.org/media/keys/ACCC4CF8.asc" + ) + + print("\n==> Detecting Ubuntu codename...") + codename = subprocess.check_output("lsb_release -cs", shell=True).decode().strip() + print(f" Detected: {codename}") + + print("\n==> Adding PGDG apt repository...") + repo_line = ( + f"deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] " + f"https://apt.postgresql.org/pub/repos/apt {codename}-pgdg main" + ) + with open("/etc/apt/sources.list.d/pgdg.list", "w") as f: + f.write(repo_line + "\n") + print(f" Written: {repo_line}") + + print("\n==> Updating apt package lists...") + run("apt update") + + print("\n==> Installing PostgreSQL 17...") + run("apt install -y postgresql-17") + + print("\n✅ PostgreSQL 17 installed successfully.") + +if __name__ == "__main__": + if subprocess.run("id -u", shell=True, capture_output=True).stdout.strip() != b"0": + print("This script must be run as root. Try: sudo python3 install_postgres17.py") + sys.exit(1) + main() \ No newline at end of file From 63aca26125edef683cd8831fbb2e3e079ad2869a Mon Sep 17 00:00:00 2001 From: David Pollard Date: Sat, 21 Mar 2026 14:22:25 -0700 Subject: [PATCH 3/3] feat: add installation script for PostgreSQL 17 --- scripts/{postgres_upgrade_2_17.py => install_postgres17.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{postgres_upgrade_2_17.py => install_postgres17.py} (100%) diff --git a/scripts/postgres_upgrade_2_17.py b/scripts/install_postgres17.py similarity index 100% rename from scripts/postgres_upgrade_2_17.py rename to scripts/install_postgres17.py