migrate database from SQLite to PostgreSQL; add PostgreSQL adapter and migration script
This commit is contained in:
@@ -2,6 +2,17 @@
|
||||
|
||||
Never run direct database operations (inserts, updates, deletes, schema changes) against the local SQLite files (e.g. intelligence.sqlite, archive.sqlite). These are local copies and do not affect the production database. All data changes must go through code that runs in production — seed functions, migration scripts, workers, etc.
|
||||
|
||||
# Remote Database Queries
|
||||
|
||||
To query the remote production database, POST to `https://duriin.imbenji.net/admin/api/sql` with HTTP Basic Auth (credentials in config.json at `admin.username` / `admin.password`). Use the field names `sql` and `database` (`"archive"` or `"intelligence"`):
|
||||
|
||||
```
|
||||
POST /admin/api/sql
|
||||
{ "sql": "SELECT ...", "database": "intelligence" }
|
||||
```
|
||||
|
||||
Note: SQLite syntax only — no `LEFT()`, use `substr()` instead. Response shape: `{"results": [{"rows": [...]}], "elapsed": N}`.
|
||||
|
||||
# Database Policy
|
||||
|
||||
When making any changes to the database schema or data, a strictly no data loss policy must be followed. This means:
|
||||
|
||||
Reference in New Issue
Block a user