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

Multiple Schemas with Annotations #356

Open
terily opened this issue Jul 10, 2016 · 16 comments
Open

Multiple Schemas with Annotations #356

terily opened this issue Jul 10, 2016 · 16 comments

Comments

@terily
Copy link

@terily terily commented Jul 10, 2016

1,Entity

image

2, Error
image

What is the right steps to define schemas ?

@greenrobot-team
Copy link
Collaborator

@greenrobot-team greenrobot-team commented Jul 11, 2016

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
Copy link

@YZHIWEN YZHIWEN commented Jul 11, 2016

I still have this problem when I change the schemaVersion.

@greenrobot
Copy link
Owner

@greenrobot greenrobot commented Jul 11, 2016

If you only have a single schema, do not define schema in @entity.

Multiple schemas is not yet official for annotations.

@sixgodIT
Copy link

@sixgodIT sixgodIT commented Jul 12, 2016

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 changed the title What is the right steps to define schemas ? Multiple Schemas with Annotations Jul 28, 2016
@moneyDragon
Copy link

@moneyDragon moneyDragon commented Aug 5, 2016

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

@fortuneFelix
Copy link

@fortuneFelix fortuneFelix commented Oct 3, 2016

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

@PittyXu
Copy link

@PittyXu PittyXu commented Oct 13, 2016

Same, keep 2.x until this issue

@tatianasolonets
Copy link

@tatianasolonets tatianasolonets commented Oct 24, 2016

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

@greenrobot-team
Copy link
Collaborator

@greenrobot-team greenrobot-team commented Oct 25, 2016

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

@RiccardoM
Copy link

@RiccardoM RiccardoM commented May 11, 2017

@greenrobot-team Any update on this so far?

@yunfeng1213
Copy link

@yunfeng1213 yunfeng1213 commented May 16, 2017

@greenrobot-team Any update on this so far? support more than one sqllite databases

@kapaseker
Copy link

@kapaseker kapaseker commented Aug 23, 2017

support more than one sqllite databases,please。。。

@dongcl
Copy link

@dongcl dongcl commented Nov 20, 2017

support more than one sqllite databases,please。。。+1

@TrueKage
Copy link

@TrueKage TrueKage commented Dec 8, 2017

@greenrobot-team Any update on this feature so far?

@xwangly
Copy link

@xwangly xwangly commented Dec 27, 2017

Any update on this feature so far?

@titanseason
Copy link

@titanseason titanseason commented Dec 28, 2017

If you want to use multiple schemas:
Do delete classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' in your root project's build.gradle and delete apply plugin: 'org.greenrobot.greendao' in your app project's build.gradle

Just keep compile 'org.greenrobot:greendao:3.2.2' in your app project's build.gradle

And use dao-generator to generate entities and DAOs

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

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.