How to create multiple tables in a database in sqflite?

后端 未结 6 1934
礼貌的吻别
礼貌的吻别 2021-01-11 11:51

Im building and app with flutter that uses SQLite database. I have created first table using this piece of code:

 void _createDb(Database db, int newVersion)         


        
6条回答
  •  Happy的楠姐
    2021-01-11 12:16

    Hard to say without seeing your openDatabase call and whether the database exists before or not. One of my guess is that you are still using the same database version. Once onCreate has been called it will never be called again. You should try to bump your database version and add the new table in on onUpgrade

提交回复
热议问题