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

Implement 'create index' migrations #49

Merged
merged 3 commits into from
Aug 17, 2023
Merged

Implement 'create index' migrations #49

merged 3 commits into from
Aug 17, 2023

Conversation

andrew-farries
Copy link
Collaborator

Add support for create index migrations. A create index migration looks like this:

{
  "name": "10_create_index",
  "operations": [
    {
      "create_index": {
        "table": "fruits",
        "columns": [
          "name"
        ]
      }
    }
  ]
}
  • On Start the index is added to the underlying table.
  • On Rollback the index is removed from the underlying table.
  • Complete is a no-op.

There are more options that could be supported here, but are not included in this PR including:

  • Different index types besides the default (btree)
  • UNIQUE
  • NULLS FIRST / LAST
  • NULLS DISTINCT
  • Partial indexes

@andrew-farries andrew-farries force-pushed the drop-column branch 2 times, most recently from 432ef69 to b82044b Compare August 17, 2023 06:35
Base automatically changed from drop-column to main August 17, 2023 06:37
@andrew-farries andrew-farries force-pushed the create-index branch 2 times, most recently from 94ff960 to e712e62 Compare August 17, 2023 06:47
@andrew-farries andrew-farries force-pushed the create-index branch 2 times, most recently from 9d0e182 to e6d32f4 Compare August 17, 2023 10:48
@andrew-farries andrew-farries merged commit 9b7409b into main Aug 17, 2023
3 checks passed
@andrew-farries andrew-farries deleted the create-index branch August 17, 2023 10:51
andrew-farries added a commit that referenced this pull request Aug 17, 2023
If specified, use the given name as the name of index, otherwise fall
back to using a generated name.

Follow up to #49, in particular
[this
comment](#49 (comment)).
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.

None yet

2 participants