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

[Bug] Columns using TypeConverter are always stored with TEXT #1481

Closed
DreierF opened this issue Nov 17, 2017 · 3 comments
Closed

[Bug] Columns using TypeConverter are always stored with TEXT #1481

DreierF opened this issue Nov 17, 2017 · 3 comments
Labels
Milestone

Comments

@DreierF
Copy link

DreierF commented Nov 17, 2017

DBFlow Version: 4.1.2
Issue Kind (Bug, Question, Feature): Bug

Please note if you are using Instant Run, there may be bugs where generated classes are not created. Ensure you are using
the apt or kapt plugins and that incremental compilation is off.

Description:
Previous versions of dbFlow (I'm migrating from 3.1.1) did respect the return type of the custom type converter. For the example below a column of type BLOB was created in sqlite for thumbnail:

@Column(typeConverter = ThumbnailConverter.class)
public Thumbnail thumbnail;
public final class ThumbnailConverter extends TypeConverter<Blob, Thumbnail> {
    ...
}

In 4.1.2 I get a column of type TEXT regardless of the type I convert my object to (Blob above, but also happens for all other types). Is this new behavior expected?

@anastasia-zaitsewa
Copy link

anastasia-zaitsewa commented Nov 24, 2017

Wanna join since I have the same issue migrating from 3.1.1.

We use LocalDate as a primary key for one of our models and a TypeConverter to make the long out of it.

What 3.1.1 was generating in ModelWithLocalDate_Adapter:

"CREATE TABLE IF NOT EXISTS `ModelWithLocalDate`(`day` INTEGER,`someField` TEXT, PRIMARY KEY(`day`) ON CONFLICT REPLACE" + ");"

And here is what I am getting with 4.1.2 in ModelWithLocalDate_Table:

"CREATE TABLE IF NOT EXISTS `ModelWithLocalDate`(`day` TEXT, `assignments` TEXT, PRIMARY KEY(`day`) ON CONFLICT REPLACE)"

Is there are a chance to get a workaround for that?

@agrosner
Copy link
Owner

Sounds like a bug.

@agrosner agrosner added this to the 4.2.2 milestone Dec 18, 2017
@agrosner agrosner mentioned this issue Dec 18, 2017
@agrosner agrosner added the bug label Dec 18, 2017
@agrosner
Copy link
Owner

released. 4.2.2

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

3 participants