我一直在尝试使用4个表创建一个模式,但是当我运行我的代码时,只创建了一个表(Facts)。有任何想法吗?
private static String wdft_query="CREATE TABLE WDayFactTracks ( _id INTEGER PRIMARY KEY ASC AUTOINCREMENT,dayAcomplishedPerWeek INTEGER)";
private static String wf_query="CREATE TABLE WFacts ( _id INTEGER PRIMARY KEY ASC AUTOINCREMENT, name TEXT UNIQUE, wday REFERENCES WDayFactTracks ( _id ) ))";
private static String wt_query="CREATE TABLE WTracks (_id INTEGER PRIMARY KEY ASC AUTOINCREMENT, currentDate DATE, weight REAL NOT NULL, wday REFERENCES WDayFactTracks ( _id ) );";
private static String wu_query="CREATE TABLE WUser ( _id INTEGER PRIMARY KEY NOT NULL UNIQUE, name TEXT NOT NULL, wtrack_id INT REFERENCES WTracks ( _id ), wfact REFERENCES WFacts ( _id ) );";
public ModeloBD(Context context, CursorFactory factory,
int version) {
super(context, BDName, factory, version);
// TODO Auto-generated constructor stub
}
public ModeloBD(Context context){
super(context, BDName, null, version_t);
}
@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
//db.execSQL(BDQuery); crea solo una tabla
db.execSQL(wdft_query);
db.execSQL(wf_query);
db.execSQL(wt_query);
db.execSQL(wu_query);
//inicializacion de datos
db.execSQL("INSERT INTO WUser (_id,name,wtrackid,wfact) VALUES (1,test,,)");
}