Compare commits

...

2 commits

Author SHA1 Message Date
4bc556aec5 bump: version 0.4.0 → 0.4.1 2026-02-17 20:12:38 -06:00
e520a34fa5 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.
2026-02-17 18:13:16 -06:00
6 changed files with 45 additions and 18 deletions

View file

@ -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/) 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). 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) ## v0.4.0 (2026-02-17)
### Feat ### Feat

View file

@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "WuttaFarm" name = "WuttaFarm"
version = "0.4.0" version = "0.4.1"
description = "Web app to integrate with and extend farmOS" description = "Web app to integrate with and extend farmOS"
readme = "README.md" readme = "README.md"
authors = [ authors = [

View file

@ -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
),
)

View file

@ -37,11 +37,7 @@ class AnimalType(model.Base):
""" """
__tablename__ = "animal_type" __tablename__ = "animal_type"
__versioned__ = { __versioned__ = {}
"exclude": [
"changed",
],
}
__wutta_hint__ = { __wutta_hint__ = {
"model_title": "Animal Type", "model_title": "Animal Type",
"model_title_plural": "Animal Types", "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( farmos_uuid = sa.Column(
model.UUID(), model.UUID(),
nullable=True, nullable=True,

View file

@ -412,7 +412,6 @@ class AnimalTypeImporter(FromFarmOS, ToWutta):
"drupal_id", "drupal_id",
"name", "name",
"description", "description",
"changed",
] ]
def get_source_objects(self): def get_source_objects(self):
@ -427,7 +426,6 @@ class AnimalTypeImporter(FromFarmOS, ToWutta):
"drupal_id": animal_type["attributes"]["drupal_internal__tid"], "drupal_id": animal_type["attributes"]["drupal_internal__tid"],
"name": animal_type["attributes"]["name"], "name": animal_type["attributes"]["name"],
"description": animal_type["attributes"]["description"], "description": animal_type["attributes"]["description"],
"changed": self.normalize_datetime(animal_type["attributes"]["changed"]),
} }

View file

@ -45,7 +45,6 @@ class AnimalTypeView(AssetTypeMasterView):
grid_columns = [ grid_columns = [
"name", "name",
"description", "description",
"changed",
] ]
sort_defaults = "name" sort_defaults = "name"
@ -57,7 +56,6 @@ class AnimalTypeView(AssetTypeMasterView):
form_fields = [ form_fields = [
"name", "name",
"description", "description",
"changed",
"farmos_uuid", "farmos_uuid",
"drupal_id", "drupal_id",
] ]