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

proper migrate to hypertable #14

Merged
merged 7 commits into from
Apr 20, 2021

Conversation

daadu
Copy link
Contributor

@daadu daadu commented Apr 19, 2021

updated TimescaleSchemaEditor for postgres backend

  • extending postgres.schema.DatabaseSchemaEditor instead of postgis.schema.PostGISSchemaEditor
  • rename drop_primary_key -> _drop_primary_key and create_hypertable -> _create_hypertable
  • _create_hypertable: explictly calling _drop_primary_key, also added should_migrate arg
  • _assert_is_hypertable and _assert_is_not_hypertable methods added and integrated with _create_hypertable
  • _set_chunk_time_interval method added
  • override add_field and alter_field methods of DatabaseSchemaEditor

after review

  • update README
  • apply this changes to "postgis" backend

Closes #13

- extending `postgres.schema.DatabaseSchemaEditor` instead of `postgis.schema.PostGISSchemaEditor`
- rename `drop_primary_key` -> `_drop_primary_key` and `create_hypertable` -> `_create_hypertable`
- `_create_hypertable`: explictly calling `_drop_primary_key`, also added `should_migrate` arg
- `_assert_is_hypertable` and `_assert_is_not_hypertable` methods added and integrated with `_create_hypertable`
- `_set_chunk_time_interval` method added
- override `add_field` and `alter_field` methods
@daadu
Copy link
Contributor Author

daadu commented Apr 19, 2021

Once approved will do same chages to "postgis" backend

@daadu
Copy link
Contributor Author

daadu commented Apr 19, 2021

@schlunsen @bencleary Request you to review this.

@daadu
Copy link
Contributor Author

daadu commented Apr 19, 2021

I have tested with timescale/timescaledb:2.1.1-pg13 docker image

@daadu
Copy link
Contributor Author

daadu commented Apr 19, 2021

@schlunsen the "migrate with fresh table" option discussed at #13 is not implemented but have kept a placeholder as of now.

Will wait if someone requests for it. Created new issue #16 for it.

@daadu
Copy link
Contributor Author

daadu commented Apr 19, 2021

README changes are pending too, will do that once code is reviewed.

@schlunsen
Copy link
Collaborator

Looking good!

@daadu
Copy link
Contributor Author

daadu commented Apr 20, 2021

Updated README and applied same changes to postgis schema

@schlunsen schlunsen merged commit 757f163 into jamessewell:main Apr 20, 2021
@daadu daadu deleted the migrate_to_hypertable branch August 17, 2021 10:49
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.

MIgration of exiting Table to Hypertable not working
2 participants