PSA/server/seeds/dev/65_asset_documents.cjs
Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

148 lines
6.1 KiB
JavaScript

exports.seed = async function(knex) {
// Get necessary references
const tenant = await knex('tenants').select('tenant').first();
const docType = await knex('document_types').where({ type_name: 'Manual' }).first();
const glinda = await knex('users').where({ username: 'glinda' }).first();
const assets = await knex('assets').select('asset_id', 'name');
if (tenant && docType && glinda) {
const now = new Date().toISOString();
// Create new documents
const [doc1, doc2, doc3, doc4] = await knex('documents').insert([
{
tenant: tenant.tenant,
document_name: 'Ruby Slippers Server Manual',
type_id: docType.type_id,
user_id: glinda.user_id,
created_by: glinda.user_id,
entered_at: now,
content: `Ruby Slippers Server Configuration Guide
1. Power Management
- Ensure magical power crystals are properly aligned
- Monitor ruby energy signature levels
- Maintain optimal temperature at 20°C
2. Performance Optimization
- Regular defragmentation of enchanted storage
- Memory crystal cleansing procedure
- Backup spell configuration
3. Troubleshooting
- Common magical interference patterns
- Emergency power redirection procedures
- Crystal realignment steps`
},
{
tenant: tenant.tenant,
document_name: 'Looking Glass Workstation Guide',
type_id: docType.type_id,
user_id: glinda.user_id,
created_by: glinda.user_id,
entered_at: now,
content: `Looking Glass Setup and Maintenance
1. Mirror Alignment
- Proper reflection angle calibration
- Reality distortion prevention
- Wonderland portal stability checks
2. Display Configuration
- Reality-to-screen mapping
- Through-the-glass rendering settings
- Multi-dimensional display scaling
3. Safety Protocols
- Emergency reality anchor procedures
- Looking glass crack prevention
- Reality sync maintenance`
},
{
tenant: tenant.tenant,
document_name: 'Tea Time Server Procedures',
type_id: docType.type_id,
user_id: glinda.user_id,
created_by: glinda.user_id,
entered_at: now,
content: `Mad Hatter's Tea Time Server Guide
1. Tea Time Optimization
- Server clock synchronization with tea time
- Optimal tea temperature monitoring
- Unbirthday celebration handling
2. Performance Metrics
- Teacup/second processing rate
- Dormouse awakening prevention
- March Hare request routing
3. Maintenance Schedule
- Daily tea refreshing
- Weekly cup rotation
- Monthly riddle database update`
},
{
tenant: tenant.tenant,
document_name: 'Crystal Ball Workstation Setup',
type_id: docType.type_id,
user_id: glinda.user_id,
created_by: glinda.user_id,
entered_at: now,
content: `Crystal Ball Configuration Manual
1. Initial Setup
- Crystal clarity optimization
- Future-sight resolution settings
- Temporal sync configuration
2. Maintenance
- Daily crystal polishing procedure
- Vision calibration steps
- Prophecy cache clearing
3. Troubleshooting
- Dealing with cloudy visions
- Timeline desynchronization fixes
- Emergency fortune recovery`
}
]).returning(['document_id', 'document_name']);
// Create document associations
await knex('asset_document_associations').insert([
{
tenant: tenant.tenant,
asset_id: assets.find(a => a.name === 'Ruby Slippers Server').asset_id,
document_id: doc1.document_id,
notes: 'Official server documentation and procedures',
created_by: glinda.user_id,
created_at: now
},
{
tenant: tenant.tenant,
asset_id: assets.find(a => a.name === 'Looking Glass Workstation').asset_id,
document_id: doc2.document_id,
notes: 'Essential setup and maintenance procedures',
created_by: glinda.user_id,
created_at: now
},
{
tenant: tenant.tenant,
asset_id: assets.find(a => a.name === 'Mad Hatter Tea Time Server').asset_id,
document_id: doc3.document_id,
notes: 'Critical tea time server procedures',
created_by: glinda.user_id,
created_at: now
},
{
tenant: tenant.tenant,
asset_id: assets.find(a => a.name === 'Crystal Ball Workstation').asset_id,
document_id: doc4.document_id,
notes: 'Workstation setup and maintenance guide',
created_by: glinda.user_id,
created_at: now
}
]);
}
};