Multiple Schemas with Annotations #356

Open
terily opened this Issue Jul 10, 2016 · 10 comments

Projects

None yet

10 participants

@terily
terily commented Jul 10, 2016

1,Entity

image

2, Error
image

What is the right steps to define schemas ?

@greenrobot-team
Collaborator

This error message is a little cryptic @greenrobot. But what I can gather from the migration documentation you have to add the schema version number to your build.gradle file (where your android config is as well):

greendao {
    schemaVersion 1
}

-ut

@YZHIWEN
YZHIWEN commented Jul 11, 2016

I still have this problem when I change the schemaVersion.

@greenrobot
Owner

If you only have a single schema, do not define schema in @Entity. Multiple schemas is not yet official for annotations

@sixgodIT

Greendao3.0 does not support multiple schema definition? I was in the generator used in the project
_The new Schema (" user ", 1, "com. Example. Test. Greendao");_
After updated to 3.0

Error:Execution failed for task ':app:greendao'.
 Undefined schema \"user\" (referenced in entities: UserDb).
  Please, define non-default schemas explicitly inside build.gradle
@greenrobot greenrobot added the Feature label Jul 28, 2016
@greenrobot greenrobot changed the title from What is the right steps to define schemas ? to Multiple Schemas with Annotations Jul 28, 2016
@moneyDragon

i have the same problem,an existing project has four db,so i can't use one schema,please develope this feature asap~

@luxiaoming

看来没解决啊

@fortuneFelix

Same here - i have two sqllite databases. So far extremely happy with GreenDao! I hope you support multiple DBs going forward!

@PittyXu
PittyXu commented Oct 13, 2016

Same, keep 2.x until this issue

@TaniaSolo

Oh no, I need it ASAP. When this feature will be ready?

@greenrobot-team
Collaborator

To all above: you can continue using greenDAO 2 without any issues. The documentation for the generator also remains available.

Please refrain from "me too" comments. Use the smiley face to add a +1 reaction instead!
-ut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment