v0.10.6 auto update tenants (seed)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jama-backend",
|
||||
"version": "0.10.5",
|
||||
"version": "0.10.6",
|
||||
"description": "TeamChat backend server",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -273,6 +273,9 @@ router.post('/tenants/:slug/migrate', async (req, res) => {
|
||||
const tenant = await queryOne('public', 'SELECT * FROM tenants WHERE slug=$1', [req.params.slug]);
|
||||
if (!tenant) return res.status(404).json({ error: 'Tenant not found' });
|
||||
await runMigrations(tenant.schema_name);
|
||||
await seedSettings(tenant.schema_name);
|
||||
await seedEventTypes(tenant.schema_name);
|
||||
await seedUserGroups(tenant.schema_name);
|
||||
const applied = await query(tenant.schema_name, 'SELECT * FROM schema_migrations ORDER BY version');
|
||||
res.json({ success: true, migrations: applied });
|
||||
} catch (e) { res.status(500).json({ error: e.message }); }
|
||||
@@ -287,6 +290,11 @@ router.post('/migrate-all', async (req, res) => {
|
||||
for (const t of tenants) {
|
||||
try {
|
||||
await runMigrations(t.schema_name);
|
||||
// Also re-run seeding so new defaults (e.g. user groups, event types)
|
||||
// are applied to existing tenants that were provisioned before they existed.
|
||||
await seedSettings(t.schema_name);
|
||||
await seedEventTypes(t.schema_name);
|
||||
await seedUserGroups(t.schema_name);
|
||||
results.push({ slug: t.slug, status: 'ok' });
|
||||
} catch (e) {
|
||||
results.push({ slug: t.slug, status: 'error', error: e.message });
|
||||
|
||||
2
build.sh
2
build.sh
@@ -13,7 +13,7 @@
|
||||
# ─────────────────────────────────────────────────────────────
|
||||
set -euo pipefail
|
||||
|
||||
VERSION="${1:-0.10.5}"
|
||||
VERSION="${1:-0.10.6}"
|
||||
ACTION="${2:-}"
|
||||
REGISTRY="${REGISTRY:-}"
|
||||
IMAGE_NAME="jama"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jama-frontend",
|
||||
"version": "0.10.5",
|
||||
"version": "0.10.6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Reference in New Issue
Block a user