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

Upgrade Drift to 2.23.0; start using new features #1248

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

PIG208
Copy link
Member

@PIG208 PIG208 commented Jan 3, 2025

This prepares for #97 (PR #1167).

@PIG208 PIG208 added the maintainer review PR ready for review by Zulip maintainers label Jan 3, 2025
@PIG208 PIG208 requested a review from chrisbobbe January 3, 2025 04:05
PIG208 added 9 commits January 7, 2025 10:28
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Signed-off-by: Zixuan James Li <zixuan@zulip.com>
… 2.23.0

We will start requiring the more recent features added in releases
since 2.5.0.

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
The tests are adapted from the test template generated from
`dart run drift_dev make-migrations`.

This saves us from writing the simple migration tests between schemas
without data in the future. For the test that upgrade the schema with
data, with the helper, while it ended up having more lines than the
original, the test becomes more structured this way.

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
An alternative to this is `dart run drift_dev make-migrations`, which is
essentially a wrapper for the `schema {dump,generate,steps}`
subcommands.  `make-migrations` let us manage multiple database schemas
by configuring them with `build.yaml`, and it dictates the
which subdirectories the generated files will be created at.

Because `make-migrations` does not offer the same level of customizations
to designate exactly where the output files will be, opting out from it
for now.

We can revisit this if it starts to offer features that are not
available with the subcommands, or that we find the need for managing
multiple databases.

See also:
  https://drift.simonbinder.eu/migrations/step_by_step/#manual-generation

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
We previously missed tables that are not known to the schema.  This
becomes an issue if a new table is added at a newer schema level. When
we go back to an earlier schema, that new table remains in the database,
so subsequent attempts to upgrade to the later schema level that adds
the table will fail, because it already exists.

Testing for this is blocked until zulip#1172.

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants