Skip to content

Store relevant JSON values in the history table - #55

Merged
gagnieray merged 1 commit into
developfrom
feature/store-json-values
Aug 18, 2026
Merged

Store relevant JSON values in the history table#55
gagnieray merged 1 commit into
developfrom
feature/store-json-values

Conversation

@gagnieray

Copy link
Copy Markdown
Member

No description provided.

@gagnieray
gagnieray marked this pull request as ready for review August 17, 2026 18:01
@gagnieray

Copy link
Copy Markdown
Member Author

@trasher, when you have a moment, could you please take a look at my scripts for updating the database schema? I’m considering adding the ability to filter the payment history. So I needed to extract values from the stored JSON query. And in addition, for MySQL/MariaDB, I also updated the character set and the encoding for collations. Thanks!

@gagnieray
gagnieray requested a review from trasher August 17, 2026 18:01
@trasher

trasher commented Aug 18, 2026

Copy link
Copy Markdown
Member

I ran the mysql install script from develop branch; and tried to update; I had several errors on first lines:

  • galette_stripe_types_cotisation_prices table does not exist
  • CHANGE COLUMN comment comments field is already names comments
  • CHANGE COLUMN metadata request text there is no such column

It looks like issues are the same on master branch.
Did I miss something?

@gagnieray

Copy link
Copy Markdown
Member Author

Well, in my opinion, the "normal" update path should be from version 0.0.3 (compatible with Galette 9.4.2) to version 1.0.0 (compatible with Galette 1.3.0) without going through the pre-releases (because I’ve always advised against using pre-releases in production).

But I’m probably wrong to think about it that way 😕

In practice, some people will inevitably have already used the alpha1 version in production, and I should take that into account. In that case, it might be badly received if I tell them to reinstall the plugin without using an update. What do you think? 🤔

In any case, to test the update under the conditions currently planned, you need first to roll back the database to the state it was in for version 0.0.3:

CREATE TABLE galette_stripe_types_cotisation_prices ( 
  dummy_column text 
);
ALTER TABLE galette_stripe_history
  CHANGE COLUMN comments comment VARCHAR(255),
  CHANGE COLUMN request metadata TEXT
  DROP COLUMN payer_name;

@trasher

trasher commented Aug 18, 2026

Copy link
Copy Markdown
Member

OK, I indeed had missed something... I took the SQL script from the main branch and not from the latest stable. Tested again with the correct script; update went fine!

But I’m probably wrong to think about it that way 😕

No, you're right. alpha versions of the plugin are not designed to be used in production; just as 1.3-dev Galette ;)

Upgrading from a development snapshot has never been supported in Galette and plugins (I often not release any alpha/beta so I do not have to deal with that kind of issues :p).

@trasher trasher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I cannot test JSON migration itself; I do not have any data.

@gagnieray
gagnieray force-pushed the feature/store-json-values branch from b3a28c7 to 53f4fad Compare August 18, 2026 10:20
@gagnieray
gagnieray merged commit 78ce696 into develop Aug 18, 2026
9 checks passed
@gagnieray
gagnieray deleted the feature/store-json-values branch August 18, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants