Data cleaned-up after each deploy

We are using Manifest together with DO apps, and everytime when new deploy is happening, database cleaned up, looks like file for SQLlite created from scratch. How to prevent it? Or it's possible to connect to external DB?
7 Replies
SebConejo
SebConejo4w ago
Hi @Ararat Martirossyan . We are working on it. We hope to find a solution this week.
Ararat Martirossyan
I saw in your code base that path to DB file is hardcoded string, what if we will make it this way and we will able to define our own path, on s3 or VPS.
import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions'

export default (): { database: SqliteConnectionOptions } => {
return {
database: {
type: 'sqlite',
database: process.env.DB_PATH || `${process.cwd()}/manifest/backend.db`,
dropSchema: process.env.DB_DROP_SCHEMA === 'true' || false,
synchronize: true
}
}
}
import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions'

export default (): { database: SqliteConnectionOptions } => {
return {
database: {
type: 'sqlite',
database: process.env.DB_PATH || `${process.cwd()}/manifest/backend.db`,
dropSchema: process.env.DB_DROP_SCHEMA === 'true' || false,
synchronize: true
}
}
}
DB_PATH will be an env that will help us to identify our persistent storage path
brunobuddy
brunobuddy3w ago
Hello @Ararat Martirossyan we just published a new version (https://github.com/mnfst/manifest/releases/tag/manifest%404.7.0) with PostgreSQL compatibility in order to have DB persistence. It's easy to setup and does not change anything on the app level, you can use it even if not familiar with Postgres. Indeed most Platform-as-a-Service services (like DO app platform) use ephemeral data that gets deleted after each deploy/restart. This is not the case in traditional VM hosting (DO droplet) or bare metal servers. We still have the issue for file/image uploads (if you use those property types) and we are currently working on an adapter for S3 storage services for data persistence regarding files. Let me know if it does the job ! Quick note: Sqlite on S3 is not a good idea as Manifest would need to download and upload the whole DB at each write operation.
GitHub
Release [email protected] · mnfst/manifest
Minor Changes de762de: added Postgres compatibility, asked by @ToxesFoxes, @dotku
Vaqif
Vaqif2w ago
Can you please add connection to mysql also?
brunobuddy
brunobuddy2w ago
I added it to our backlog
Stefano Lab
Stefano Lab2w ago
I think that MySQL or MariaDB connection is definitively a must it is an awesome project, but you must consider that not everybody is familiar with PostGres, and personally i have lots of projects that can be reworked with "manifest", but based on MySQL database
brunobuddy
brunobuddy2w ago
@Stefano Lab we are on it ! It will be available next week

Did you find this page helpful?