I'm migrating a Fastify/Typescript backend to Appwrite.
I would like to know if it is a good practice to use functions to create the database structure.
Currently I'm not having a good experience with the Console. So I would like to know if it would be possible to use something like the image and then do the creation loop in main.
Future<dynamic> main(final context) async {
final client = Client()
.setEndpoint(Platform.environment['_APP_DOMAIN']!)
.setProject(Platform.environment['PROJECT_ID'])
.setKey(Platform.environment['API_KEY']);
final plans = Plans(Databases(client));
if (await plans.needCreate()) {
await plans.create();
}
}