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

Create extensions in the migration generator #23

Closed
zachdaniel opened this issue Oct 6, 2020 · 3 comments
Closed

Create extensions in the migration generator #23

zachdaniel opened this issue Oct 6, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zachdaniel
Copy link
Contributor

Right now, we create a snapshot for each resource. In order to create (and rollback) extensions in the migration generator, we will need to track another snapshot just for the repo, and we would currently only store the list of extensions. Then, when migrations are generated, we'd go through each resource in each API, grab their repo, unique them, and create snapshot for them w/ their extensions. Any extensions in the new list that aren't in the old list should be added in the generated migration.

@zachdaniel zachdaniel added enhancement New feature or request good first issue Good for newcomers labels Oct 6, 2020
@zachdaniel
Copy link
Contributor Author

zachdaniel commented Oct 6, 2020

We can generate code something like this:

  def up do
    execute("CREATE EXTENSION \"uuid-ossp\";")
    execute("CREATE EXTENSION \"pg_trgm\";")
  end

  def down do
    execute("DROP EXTENSION \"uuid-ossp\"")
    execute("DROP EXTENSION \"pg_trgm\"")
  end

@zachdaniel
Copy link
Contributor Author

We should consider getting a list of extensions that are installable in this way, and storing that in the repo. Then, if anything is not in the list, we can tell them to install it themselves.

@zachdaniel
Copy link
Contributor Author

This is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant