| 799 | } |
| 800 | |
| 801 | bool ProjectFileIO::InstallSchema(sqlite3 *db, const char *schema /* = "main" */) |
| 802 | { |
| 803 | int rc; |
| 804 | |
| 805 | wxString sql; |
| 806 | sql.Printf(ProjectFileSchema, ProjectFileID, BaseProjectFormatVersion.GetPacked()); |
| 807 | sql.Replace("<schema>", schema); |
| 808 | |
| 809 | rc = sqlite3_exec(db, sql, nullptr, nullptr, nullptr); |
| 810 | if (rc != SQLITE_OK) |
| 811 | { |
| 812 | SetDBError( |
| 813 | XO("Unable to initialize the project file") |
| 814 | ); |
| 815 | return false; |
| 816 | } |
| 817 | |
| 818 | return true; |
| 819 | } |
| 820 | |
| 821 | // The orphan block handling should be removed once autosave and related |
| 822 | // blocks become part of the same transaction. |