question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal for contributing WatermelonDB Migration Generator

See original GitHub issue

Hey, @radex !

I previously made a migration yeoman generator for realm-js to help with managing linear migrations: https://www.npmjs.com/package/generator-realm-migration

WatermelonDB’s migrations are understandably different from realm-js. But the same core scenario occurs where some table’s schema gets changed and you need a migration created for it. This migration wouldn’t cover performing CRUD operations to to migrate existing data to the next schema version. But it would at least cover the creation of the migration steps that would mirror the changes you made to the database schema.

What would be all of the schema alterations we would need to cover?

  • Create Table
  • Drop Table
  • Alter Table
    • Add Column
    • ???

I’m wondering if you would first like help to complete the supported schema operation steps, before even proceeding forward with a migration generator based on your comment here: https://nozbe.github.io/WatermelonDB/Advanced/Migrations.html#migration-steps

In any case, let me know what you think!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pokeycommented, Jul 30, 2020

Fwiw, Alembic has support for dropping / altering columns in SQLite tables by bulk recreating the table, and will even automatically generate a migration to do so. Might be worth having a peek at their impl if Watermelondb decides to support such a thing down the road

0reactions
landonwjohnsoncommented, Nov 17, 2021

I would like to see a migration for sequelize and mysql.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog - WatermelonDB documentation - GitHub Pages
You're welcome to contribute an automatic migration code. Note that this option is still experimental, and might change in breaking ways at any...
Read more >
Using WatermelonDB for offline data sync - LogRocket Blog
Syncing data outside a mobile device is a common feature for offline React Native apps. WatermelonDB comes with this feature out of the...
Read more >
Search Results - CVE
The manipulation of the argument m_id/plan leads to sql injection. ... CVE-2022-3300, The Form Maker by 10Web WordPress plugin before 1.15.6 does not ......
Read more >
@nozbe/watermelondb - npm
Start using @nozbe/watermelondb in your project by running `npm i ... @babel/plugin-proposal-nullish-coalescing-operator ...
Read more >
How and why GraphQL will influence the Sourcehut alpha
I'm working on a REST code generator (generates a Go backend and a ... pass the query tree to the optimizer which generate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found