-
Notifications
You must be signed in to change notification settings - Fork 191
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
How to upgrade the database version #726
Comments
Hey @yixiu30 |
and you lost the space between |
thank you very much! [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: DatabaseException(Error Domain=FMDatabase Code=1 "table chatrecord has no column named nameEn" UserInfo={NSLocalizedDescription=table chatrecord has no column named nameEn}) sql 'INSERT OR ABORT INTO chatrecord (chatListId, head_url, name, content, type, time, groupId, chatId, sendId, staffId, origingUrl, compressUrl, width, height, picture_local, title, fileType, filesize, filelocal, fileurl, isDownload, chatUuid, file_id, system, audioOpenEd, audioRecord, audioClick, dailyReportId, dailyReportType, isDailyReport, briefId, addContent, href, dialogHeight, upDateText, nameEn) VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' args [https://test.xiamenjwzz.com:9999/portalfile/userPi..., weijiwo, , 1, 2023-01-03 16:43:20.945, 4872098147432661014, 225739, 4804247830982033430, 2fb135026aae410d81330a4162a6983d, https://files-1304239070.cos.ap-nanjing.myqcloud.c..., https://files-1304239070.cos.ap-nanjing.myqcloud.c..., 0, 0, , , , , , , 0, cb293d40-ba08-44e3-a8a2-36fac2f9e392, d5ffd44b596845268acb84e6ba20f7f2, 0, 0, , 0, , , 0, , report, , , , ] but the database update i have add the column nameEn
});
|
@yixiu30 |
no answer for a while |
In the test process, I added the field nickname for the first time. I added two more fields, chinesename and englishname, as required. But at this time, if I upgrade the database one version at a time, there is no problem, such as versions three to four. However, if I upgrade the database from the online version two to the latest version four, I will not report an error
this is the example from three to four version,
// create migration
final migration1to2 = Migration(3, 4, (database) {
database.execute('ALTER TABLE person ADD COLUMN chinesename TEXT');
database.execute('ALTER TABLE person ADD COLUMN englishnameTEXT');
});
final database = await $FloorAppDatabase
.databaseBuilder('app_database.db')
.addMigrations([migration1to2])
.build();
The text was updated successfully, but these errors were encountered: