Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate date fields from string to Firestore Timestamp #87

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EArminjon
Copy link

@EArminjon EArminjon commented Sep 27, 2024

This PR aim to help fixing the following issue : #86

I didn't know what is the best practice to handle data migration from old extension using STRING to this new version using TIMESTAMP.

I'm pretty new to Firebase Extension :D.

@jefago
Copy link
Contributor

jefago commented Sep 30, 2024

Hi @EArminjon , thank you for the PR! We are debating internally how to handle this; the suggestion makes perfect sense but we don't want to break any existing integrations that might depend on this being stored as string.

@EArminjon
Copy link
Author

EArminjon commented Sep 30, 2024

Yep that is exactly the hard point, if firebase could support timestamp comparison with string that could save a lot of work.

If you have any contact, you can try to pressure :') !

@unxavi
Copy link

unxavi commented Oct 3, 2024

Why not storing this a new fields name? or maybe this should be a major release

@EArminjon
Copy link
Author

I think for the moment a new field is good enough.

@EArminjon
Copy link
Author

EArminjon commented Oct 10, 2024

Maybe you can use the Firebase Extension onUpdate https://firebase.google.com/docs/extensions/reference/extension-yaml#lifecycle-events, this event is used when developers update the extension. A script will be run and can handle the migration.

If developer don't want regression : they can upgrade later i believe.

Cc @jefago

@EArminjon EArminjon marked this pull request as draft October 10, 2024 19:53
@EArminjon
Copy link
Author

EArminjon commented Oct 10, 2024

Date format could also be a param which can be selected by developer when initializing the extension :
"Which date format would you use: (string / Timestamp) ?"

https://firebase.google.com/docs/extensions/reference/extension-yaml#secret-params

@EArminjon
Copy link
Author

Hello any news on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants