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

Implicitly migrate on import #20

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

edsu
Copy link
Contributor

@edsu edsu commented Oct 21, 2023

In order not to require an extra init step, and for the user not to need to know when to update their database with a migrate, we can migrate the database every time a user does an import.

Implicitly migrating the database when importing will:

  1. ensure that there is a complete database schema to import into
  2. ensure that the schema is up to date with the latest installed version of warcdb

I'm not sure if we should create a separate ticket for detecting the case when the SQLite database is for a newer version of warcdb than is installed. Perhaps we can use the _sqlite_migrations table to determine this?

sqlite> select * from _sqlite_migrations;
migration_set  name          applied_at
-------------  ------------  --------------------------
warcdb         m001_initial  2023-10-20 10:24:35.114387

Closes #18

In order not to require an extra `init` step, and for the user to know
when to update their database with a `migrate`, we can migrate the
database every time a user does an import. This will:

1. ensure that there is a complete database schema to import into
2. that it is up to date with the latest installed version of warcdb

Closes Florents-Tselai#18
@Florents-Tselai Florents-Tselai merged commit 79979eb into Florents-Tselai:main Oct 21, 2023
1 check passed
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.

init & import workflow
2 participants