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

Manual migrations #105

Closed
Menzorg opened this issue Jul 28, 2022 · 7 comments
Closed

Manual migrations #105

Menzorg opened this issue Jul 28, 2022 · 7 comments
Labels

Comments

@Menzorg
Copy link

Menzorg commented Jul 28, 2022

Hello. I spended some time to understad all what i need to do manual migration (env POSTGRES_MIGRATIONS=0). To my mind it is useful information for all who wants to use hasura-storage migrations as part of custom project migrations, and it could be in readme. Manual migration has stages:

  1. Creating schema and extensions
  2. hasura-storage/migrations/postgres/*.up.sql
  3. hasura metadata api track_table (files, buckets)
  4. hasura metadata set_table_customization (custom_name, custom_root_fields, custom_column_names)
  5. hasura metadata create relationships (object files.bucket_id -> bucket.id, array buckets.id => files.bucket_id[])
  6. hasura metadata create permissions (select, IUD)

If I had this list, I would save a day or two. But maybe it can be useful for community after all =) Maybe expand "Self-hosting the service" description?

@dbarrosop
Copy link
Member

What is your use case for manual migrations? Ideally NOBODY would have to disable migrations so I'd rather try to tackle that. It is certainly not a supported/recommended case and something that has the opportunity to add more headaches than anything else (hence why it is not documented, it is just available for very advanced users).

Manual migration has stages

I am a bit hesitant to document this in detail but we could add a note pointing to the current code that performs the migrations, just sending people to the right place.

Maybe expand "Self-hosting the service" description?

I wouldn't add it under "self-hosting" as this is not really a requirement and that might confuse people.

In any event, I'd like to hear your use case first :)

@Menzorg
Copy link
Author

Menzorg commented Jul 28, 2022

My case is project, that has own migration system. It is good, when migrating data controlled by one source, but if we will have many sources it will be hard to maintain and develop. So, when we add new lib to our project (hasura-storage), and this lib need to do something with data or data-store (pg), it is good idea to add new migration, which will add all it need, so process of project life will continue without artifacts. This migration controls changes, and fix current version of hasura-storage, so, when we will need to update -> it will be new migration in our project.

@Menzorg
Copy link
Author

Menzorg commented Jul 28, 2022

So, idea of this issue - if some project, like ours can have own migrating system, most likely developers want to create their own migration, and then -> they will want to understad what need to do.

@dbarrosop
Copy link
Member

Ok, I think I understand, we can add a note as suggested, something vague though, just to point in the right direction. I'd prefer if this was reserved to very advanced users that can look at the code and understand what's going on or this has the potential to become a mess for maintainers.

@Menzorg
Copy link
Author

Menzorg commented Jul 28, 2022

Cool, to my mind it will be great

@Menzorg
Copy link
Author

Menzorg commented Jul 28, 2022

Something like ATTENTION! ONLY FOR ADVANCED CHOSEN ONES =)

@stale
Copy link

stale bot commented May 11, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 11, 2023
@stale stale bot closed this as completed May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants