Best Practices - How to modify file structure on xojo cloud?

I’m preparing to put my first web app on xojo cloud. Since this is a new app, I’m concerned with file structure changes after data has already been entered by users of the app.

Is there a recommended way to handle this process?

Keep in mind that there are places (SharedDocuments for instance) that are not overwritten each time you deploy where your app should be storing runtime data. You will need to build a system for checking if things exist and then adding/upgrading to that as necessary.

1 Like

From the docs:

Xojo cloud

For Xojo Cloud, these are the only SpecialFolder methods that are usable. All others return Nil:

  • Fonts
  • SharedDocuments: The web server Shared_Documents folder.
  • Documents: The Documents folder within the web app folder.
  • Temporary: The web server tmp folder.
1 Like

The Documents folder should also be persistent, but I would check that first.

1 Like

I’m using shared documents for the runtime data file so it sounds like I have to build a mechanism to update the file structures in my app. I’ve done this for desktop apps so the same would be true for web apps I assume?

It should be.

In my apps I use a lot of SQLite databases and I always make a table called “prefs” with key and value fields. One pref that I store is the database schema version so when updating,n I check if schema < the current version and if it is, I update the schema and the version.

1 Like

We do the same thing with our desktop apps except out table is called DBVERSION - it contains two pieces of information - the version of the database structure and the date the database was last updated to the newest version.

We also have a function that does the updating of the file structure based on a database that gets distributed with out applications. That database file has an extension of FSM (file structure master) and it is used to update the database. It also has a DBVERSION table in it and we always compare the working database version with the one in the FSM database and if they don’t agree we know we need to update the working database.

I guess the same would work for a web app except for the fact that someone might be accessing the database so updating would have to check for that. Any ideas on how to ensure that no one is using the data file?