greenDAO icon indicating copy to clipboard operation
greenDAO copied to clipboard

Multiple Schemas with Annotations

Open terily opened this issue 8 years ago • 17 comments

1,Entity

image

2, Error image

What is the right steps to define schemas ?

terily avatar Jul 10 '16 15:07 terily

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

greenrobot-team avatar Jul 11 '16 10:07 greenrobot-team

I still have this problem when I change the schemaVersion.

yzhiwen avatar Jul 11 '16 17:07 yzhiwen

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

Multiple schemas is not yet official for annotations.

greenrobot avatar Jul 11 '16 17:07 greenrobot

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

sixgodIT avatar Jul 12 '16 06:07 sixgodIT

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

moneyDragon avatar Aug 05 '16 08:08 moneyDragon

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

fortuneFelix avatar Oct 03 '16 00:10 fortuneFelix

Same, keep 2.x until this issue

PittyXu avatar Oct 13 '16 02:10 PittyXu

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

tatianasolonets avatar Oct 24 '16 20:10 tatianasolonets

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

greenrobot-team avatar Oct 25 '16 05:10 greenrobot-team

@greenrobot-team Any update on this so far?

RiccardoM avatar May 11 '17 09:05 RiccardoM

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

yunfeng1213 avatar May 16 '17 03:05 yunfeng1213

support more than one sqllite databases,please。。。

kapaseker avatar Aug 23 '17 03:08 kapaseker

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

dongcl avatar Nov 20 '17 03:11 dongcl

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

TrueKage avatar Dec 08 '17 09:12 TrueKage

Any update on this feature so far?

xwangly avatar Dec 27 '17 05:12 xwangly

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

titanseason avatar Dec 28 '17 08:12 titanseason

what would happen if one uses multiple schemas?? I ran into some weird migration issues.

songliao-branch avatar Dec 30 '20 07:12 songliao-branch