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

Remove column's unique by contentdatabase Migration #1713

Open
wangsuicheng opened this issue Mar 1, 2021 · 1 comment
Open

Remove column's unique by contentdatabase Migration #1713

wangsuicheng opened this issue Mar 1, 2021 · 1 comment
Labels

Comments

@wangsuicheng
Copy link

DBFlow Version: 4.2

Desc:
Some columns has unique annotation, how to remove it at next migration

@agrosner
Copy link
Owner

agrosner commented Mar 5, 2021

You have to stream the old table into a new table using a Migration. Please refer to https://www.sqlite.org/lang_altertable.html for supported alter table types. We do support Table-less models via createWithDatabase = false on the Table annotation. i would make a new model that represents the old version (with Unique) then read that out of a db on migration for old version, then insert the data into the new table with the original model (and remove @Unique from that model).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants