godcrm/backend/database/migrations/knex/035_avatar_url_column.js
GOD CRM Release f89e074dd1
Some checks failed
CI / Lint / Typecheck / Test / Build (push) Has been cancelled
CI / PostgreSQL Integration Tests (push) Has been cancelled
GOD CRM — public scrubbed snapshot
Governed substrate for autonomous agents: scoped identity (passports),
audited actions, MCP workspace. Infra IPs and secrets redacted for public release.
2026-08-10 04:01:45 +03:00

16 lines
642 B
JavaScript

// ADR-099: Avatar Upload via File API
// Ensure users.avatar column is TEXT type for URL/base64 storage
// Note: Column may already be TEXT in production (was changed from VARCHAR(500) before this migration)
export async function up(knex) {
const client = knex.client.config.client;
if (client === 'pg' || client === 'postgresql') {
// Idempotent: ALTER to TEXT even if already TEXT
await knex.raw('ALTER TABLE users ALTER COLUMN avatar TYPE TEXT');
}
// SQLite: TEXT is the default string type, no change needed
}
export async function down(knex) {
// No-op: we don't want to shrink back to VARCHAR(500) and lose data
}