From e520a34fa5b52304ad180c9082aad4b710e94281 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 17 Feb 2026 18:13:16 -0600 Subject: [PATCH 1/2] fix: remove `AnimalType.changed` column that was just confusing things. WuttaFarm model should have its own notion of when things changed, and farmOS can have its own. --- .../b8cd4a8f981f_remove_animaltype_changed.py | 37 +++++++++++++++++++ src/wuttafarm/db/model/animals.py | 14 +------ src/wuttafarm/importing/farmos.py | 2 - src/wuttafarm/web/views/animals.py | 2 - 4 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py diff --git a/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py b/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py new file mode 100644 index 0000000..a43a6d4 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py @@ -0,0 +1,37 @@ +"""remove AnimalType.changed + +Revision ID: b8cd4a8f981f +Revises: aecfd9175624 +Create Date: 2026-02-17 18:11:06.110003 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = "b8cd4a8f981f" +down_revision: Union[str, None] = "aecfd9175624" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal_type + op.drop_column("animal_type", "changed") + + +def downgrade() -> None: + + # animal_type + op.add_column( + "animal_type", + sa.Column( + "changed", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + ) diff --git a/src/wuttafarm/db/model/animals.py b/src/wuttafarm/db/model/animals.py index 548be86..8c0df35 100644 --- a/src/wuttafarm/db/model/animals.py +++ b/src/wuttafarm/db/model/animals.py @@ -37,11 +37,7 @@ class AnimalType(model.Base): """ __tablename__ = "animal_type" - __versioned__ = { - "exclude": [ - "changed", - ], - } + __versioned__ = {} __wutta_hint__ = { "model_title": "Animal Type", "model_title_plural": "Animal Types", @@ -66,14 +62,6 @@ class AnimalType(model.Base): """, ) - changed = sa.Column( - sa.DateTime(), - nullable=True, - doc=""" - When the animal type was last changed, according to farmOS. - """, - ) - farmos_uuid = sa.Column( model.UUID(), nullable=True, diff --git a/src/wuttafarm/importing/farmos.py b/src/wuttafarm/importing/farmos.py index 4f9db20..b07d06d 100644 --- a/src/wuttafarm/importing/farmos.py +++ b/src/wuttafarm/importing/farmos.py @@ -412,7 +412,6 @@ class AnimalTypeImporter(FromFarmOS, ToWutta): "drupal_id", "name", "description", - "changed", ] def get_source_objects(self): @@ -427,7 +426,6 @@ class AnimalTypeImporter(FromFarmOS, ToWutta): "drupal_id": animal_type["attributes"]["drupal_internal__tid"], "name": animal_type["attributes"]["name"], "description": animal_type["attributes"]["description"], - "changed": self.normalize_datetime(animal_type["attributes"]["changed"]), } diff --git a/src/wuttafarm/web/views/animals.py b/src/wuttafarm/web/views/animals.py index bae7dde..7016e36 100644 --- a/src/wuttafarm/web/views/animals.py +++ b/src/wuttafarm/web/views/animals.py @@ -45,7 +45,6 @@ class AnimalTypeView(AssetTypeMasterView): grid_columns = [ "name", "description", - "changed", ] sort_defaults = "name" @@ -57,7 +56,6 @@ class AnimalTypeView(AssetTypeMasterView): form_fields = [ "name", "description", - "changed", "farmos_uuid", "drupal_id", ] From 4bc556aec55d4dd8eddc13187ff9ed4b2c06f460 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 17 Feb 2026 20:12:38 -0600 Subject: [PATCH 2/2] =?UTF-8?q?bump:=20version=200.4.0=20=E2=86=92=200.4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7712a..d096239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to WuttaFarm will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.4.1 (2026-02-17) + +### Fix + +- remove `AnimalType.changed` column + ## v0.4.0 (2026-02-17) ### Feat diff --git a/pyproject.toml b/pyproject.toml index 12bce62..44bea43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "WuttaFarm" -version = "0.4.0" +version = "0.4.1" description = "Web app to integrate with and extend farmOS" readme = "README.md" authors = [