const db = require('../models'); const Users = db.users; const CaseFiles = db.case_files; const Wallets = db.wallets; const TimelineEvents = db.timeline_events; const CaseArtifacts = db.case_artifacts; const RecoveryAnalyses = db.recovery_analyses; const Tags = db.tags; const RelatedCases = db.related_cases; const CaseFilesData = [ { "title": "The Landfill Millionaire Dossier", "slug": "landfill-millionaire-dossier", "status": "review", "tone": "hopeful", "format": "investigative_report", "narrator_role": "quantum_cryptographer", "loss_mechanism": "exchange_custody_failure", "hook_sentence": "A fortune survived every hack but not a household cleanup.", "summary": "A reconstruction of a discarded drive event and the years of salvage proposals that followed.", "body_content": "Case narrative covering technical factors, human decisions, and market impact for a well known landfill loss scenario.", "math_section": "Entropy was not the problem; key material was sealed behind physical destruction and time, shifting the difficulty from cryptography to archaeology.", "aftermath_section": "Permits, environmental concerns, and evolving estimates defined the post loss decade.", "now_section": "Community monitoring continues via known addresses and public statements; recovery remains unconfirmed.", "horizon_section": "Future vectors include advanced forensic recovery and controlled excavation; probability remains low.", "is_featured": true, "published_at": new Date('2025-11-20T12:00:00Z'), "incident_at": new Date('2013-08-10T00:00:00Z'), "last_verified_at": new Date('2026-01-30T00:00:00Z'), // type code here for "images" field // type code here for "files" field // type code here for "relation_one" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field }, { "title": "The Password Puzzle Case File", "slug": "password-puzzle-case-file", "status": "archived", "tone": "absurdist", "format": "human_interest_feature", "narrator_role": "true_crime_investigator", "loss_mechanism": "hardware_lockout", "hook_sentence": "The key exists, the lock holds, and time is the only attacker.", "summary": "A technical and human factors review of a hardware wallet lockout with limited remaining attempts.", "body_content": "Explains password attempt counters, threat models, and realistic recovery services and constraints.", "math_section": "Brute force feasibility is bounded by attempt limits and device security rather than hash rate.", "aftermath_section": "Legal and contractual considerations around custody and recovery service engagement.", "now_section": "Ongoing status tracked by periodic statements and on chain inactivity evidence.", "horizon_section": "Non invasive extraction research and future compute advances remain speculative.", "is_featured": true, "published_at": new Date('2025-10-04T09:00:00Z'), "incident_at": new Date('2011-07-15T00:00:00Z'), "last_verified_at": new Date('2026-02-01T00:00:00Z'), // type code here for "images" field // type code here for "files" field // type code here for "relation_one" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field }, { "title": "The Ghost Exchange Ledger", "slug": "ghost-exchange-ledger", "status": "draft", "tone": "absurdist", "format": "fictional_short_story", "narrator_role": "blockchain_archaeologist", "loss_mechanism": "accidental_destruction", "hook_sentence": "A company vanished, yet the ledger kept perfect memories.", "summary": "Custodial risk analysis of an exchange collapse and the long tail of claims and investigations.", "body_content": "Chronology of custody practices, corporate governance gaps, and user impact with quantification.", "math_section": "Transparency limits when keys are centralized and records are partial.", "aftermath_section": "Receivership actions, claimant processes, and scam waves targeting victims.", "now_section": "Case status updated as distributions and court milestones occur.", "horizon_section": "Probability tied to asset tracing outcomes rather than cryptographic breakthroughs.", "is_featured": true, "published_at": new Date('2025-08-18T16:30:00Z'), "incident_at": new Date('2018-12-09T00:00:00Z'), "last_verified_at": new Date('2026-01-20T00:00:00Z'), // type code here for "images" field // type code here for "files" field // type code here for "relation_one" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field // type code here for "relation_many" field }, ]; const WalletsData = [ { // type code here for "relation_one" field "chain": "dogecoin", "wallet_type": "unknown", "label": "Newport Drive Wallet", "address": "1HowellsX8KDump9u2wQx3pP7mZxYk2s", "xpub_or_descriptor": "xpub6CUGRUonZSQ4TWtTMmzXdrXDtyPWKi8QW9oD8bYQ3ZtWm2m9k6oGfD8pY9oGg2QpQmJ2s2Qv8qZ9HcZr7p3", "block_explorer_url": "https://example-explorer.local/btc/address/1HowellsX8KDump9u2wQx3pP7mZxYk2s", "last_seen_block_height": 286500, "last_activity_at": new Date('2013-08-10T00:00:00Z'), "amount_crypto": 8000.0, "usd_value_at_loss": 7500000.0, "usd_value_at_ath": 552000000.0, "usd_value_current": 336000000.0, "utxo_unspent_confirmed": true, "notes": "Address used as illustrative anchor; figures reflect widely reported estimates and simplified pricing assumptions.", }, { // type code here for "relation_one" field "chain": "other", "wallet_type": "custodial", "label": "IronKey Locked Wallet", "address": "1IronKeyPuzz1e7o0m9sV2u3xQ5b6n7m8", "xpub_or_descriptor": "xpub6Fh9cPjQWk3Qv6hQ9y1o1dG7V8kYp2Q2x3W9aZ7gV8hK6pQ1m2n3b4v5c6d7e8f9", "block_explorer_url": "https://example-explorer.local/btc/address/1IronKeyPuzz1e7o0m9sV2u3xQ5b6n7m8", "last_seen_block_height": 139500, "last_activity_at": new Date('2011-07-15T00:00:00Z'), "amount_crypto": 7002.0, "usd_value_at_loss": 56000.0, "usd_value_at_ath": 483138000.0, "usd_value_current": 294084000.0, "utxo_unspent_confirmed": true, "notes": "Modeled after a hardware attempt limit narrative; address and descriptor are realistic placeholders.", }, { // type code here for "relation_one" field "chain": "monero", "wallet_type": "multisig", "label": "Exchange Cold Storage Cluster", "address": "3GhostExch4ngeC0ldSt0r4ge7k2m9qP", "xpub_or_descriptor": "unknown", "block_explorer_url": "https://example-explorer.local/btc/address/3GhostExch4ngeC0ldSt0r4ge7k2m9qP", "last_seen_block_height": 556000, "last_activity_at": new Date('2018-12-09T00:00:00Z'), "amount_crypto": 26000.0, "usd_value_at_loss": 93000000.0, "usd_value_at_ath": 1794000000.0, "usd_value_current": 1092000000.0, "utxo_unspent_confirmed": false, "notes": "Custodial cases often involve multiple addresses and partial records; this entry represents an aggregated view.", }, ]; const TimelineEventsData = [ { // type code here for "relation_one" field "event_type": "press_update", "title": "Initial BTC acquisition", "description": "Coins acquired through early mining and purchases; records reconstructed from period statements.", "event_at": new Date('2010-12-01T00:00:00Z'), "block_height": 120000, "price_usd_snapshot": 0.23, "source_url": "https://example-sources.local/cases/landfill/acquisition", // type code here for "images" field // type code here for "files" field }, { // type code here for "relation_one" field "event_type": "press_update", "title": "Drive discarded during cleanup", "description": "Storage device containing wallet file removed during household cleanup and taken to municipal waste.", "event_at": new Date('2013-08-10T00:00:00Z'), "block_height": 286500, "price_usd_snapshot": 120.0, "source_url": "https://example-sources.local/cases/landfill/loss", // type code here for "images" field // type code here for "files" field }, { // type code here for "relation_one" field "event_type": "acquisition", "title": "Password attempts exhausted to near limit", "description": "Multiple failed attempts recorded; remaining attempts reported as low, increasing risk of permanent lockout.", "event_at": new Date('2011-07-15T00:00:00Z'), "block_height": 139500, "price_usd_snapshot": 8.0, "source_url": "https://example-sources.local/cases/password-puzzle/loss", // type code here for "images" field // type code here for "files" field }, ]; const CaseArtifactsData = [ { // type code here for "relation_one" field "artifact_type": "plausible_document", "title": "Excavation Proposal Summary", "content": "Document outlines a staged search plan, environmental safeguards, and contingency budgets for a controlled excavation effort.", "source_citation": "Simulated internal memo for demo content", // type code here for "files" field "is_public": true, }, { // type code here for "relation_one" field "artifact_type": "plausible_document", "title": "Device Security Expert Statement", "content": "Statement explains attempt counters, threat models, and why invasive extraction is costly and uncertain.", "source_citation": "Simulated expert testimony for demo content", // type code here for "files" field "is_public": true, }, { // type code here for "relation_one" field "artifact_type": "expert_testimony", "title": "Cluster Movement Analysis", "content": "Analysis reviews address clustering assumptions, identifies consolidation patterns, and notes uncertainty from custodial mixing.", "source_citation": "Simulated on chain analysis for demo content", // type code here for "files" field "is_public": true, }, ]; const RecoveryAnalysesData = [ { // type code here for "relation_one" field "recovery_status": "partially_recovered", "recovery_vector": "hardware_chip_off", "approach_summary": "Controlled excavation with sorting, drive imaging, and staged verification under environmental constraints.", "estimated_cost_usd": 12000000.0, "estimated_benefit_usd": 336000000.0, "estimated_probability_percent": 8.5, "analysis_at": new Date('2026-01-15T00:00:00Z'), "risk_notes": "High regulatory risk and uncertain media driven funding; physical degradation probability increases over time.", }, { // type code here for "relation_one" field "recovery_status": "deemed_impossible", "recovery_vector": "social_engineering", "approach_summary": "Non destructive attempts prioritized; invasive extraction considered only with escrow and strict chain of custody.", "estimated_cost_usd": 350000.0, "estimated_benefit_usd": 294084000.0, "estimated_probability_percent": 12.0, "analysis_at": new Date('2026-01-22T00:00:00Z'), "risk_notes": "Attempt limit and secure element protections dominate; reputational and fraud risks are significant.", }, { // type code here for "relation_one" field "recovery_status": "stalled", "recovery_vector": "neural_memory_reconstruction", "approach_summary": "Asset tracing and claims process; recovery depends on locating keys and reconciling liabilities.", "estimated_cost_usd": 9000000.0, "estimated_benefit_usd": 1092000000.0, "estimated_probability_percent": 25.0, "analysis_at": new Date('2026-01-10T00:00:00Z'), "risk_notes": "Complex proceedings and partial records; distributions may be delayed and outcomes depend on litigation.", }, ]; const TagsData = [ { "name": "Landfill recovery", "slug": "landfill-recovery", "tag_type": "artifact", "description": "Cases involving physical media loss and excavation attempts.", }, { "name": "Hardware lockout", "slug": "hardware-lockout", "tag_type": "other", "description": "Cases where secure hardware enforces attempt limits or requires lost credentials.", }, { "name": "Custodial collapse", "slug": "custodial-collapse", "tag_type": "mechanism", "description": "Exchange or custodian failures leading to inaccessible funds.", }, ]; const RelatedCasesData = [ { // type code here for "relation_one" field // type code here for "relation_one" field "relation_type": "other", "notes": "Both involve accidental destruction or loss of the only backup medium.", }, { // type code here for "relation_one" field // type code here for "relation_one" field "relation_type": "same_location", "notes": "Both show how small operational mistakes become catastrophic under strong cryptography.", }, { // type code here for "relation_one" field // type code here for "relation_one" field "relation_type": "same_location", "notes": "Contrasts centralized custody failure with self custody physical loss.", }, ]; // Similar logic for "relation_many" async function associateCaseFileWithAuthor() { const relatedAuthor0 = await Users.findOne({ offset: Math.floor(Math.random() * (await Users.count())), }); const CaseFile0 = await CaseFiles.findOne({ order: [['id', 'ASC']], offset: 0 }); if (CaseFile0?.setAuthor) { await CaseFile0. setAuthor(relatedAuthor0); } const relatedAuthor1 = await Users.findOne({ offset: Math.floor(Math.random() * (await Users.count())), }); const CaseFile1 = await CaseFiles.findOne({ order: [['id', 'ASC']], offset: 1 }); if (CaseFile1?.setAuthor) { await CaseFile1. setAuthor(relatedAuthor1); } const relatedAuthor2 = await Users.findOne({ offset: Math.floor(Math.random() * (await Users.count())), }); const CaseFile2 = await CaseFiles.findOne({ order: [['id', 'ASC']], offset: 2 }); if (CaseFile2?.setAuthor) { await CaseFile2. setAuthor(relatedAuthor2); } } // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" async function associateWalletWithCase_file() { const relatedCase_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const Wallet0 = await Wallets.findOne({ order: [['id', 'ASC']], offset: 0 }); if (Wallet0?.setCase_file) { await Wallet0. setCase_file(relatedCase_file0); } const relatedCase_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const Wallet1 = await Wallets.findOne({ order: [['id', 'ASC']], offset: 1 }); if (Wallet1?.setCase_file) { await Wallet1. setCase_file(relatedCase_file1); } const relatedCase_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const Wallet2 = await Wallets.findOne({ order: [['id', 'ASC']], offset: 2 }); if (Wallet2?.setCase_file) { await Wallet2. setCase_file(relatedCase_file2); } } async function associateTimelineEventWithCase_file() { const relatedCase_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const TimelineEvent0 = await TimelineEvents.findOne({ order: [['id', 'ASC']], offset: 0 }); if (TimelineEvent0?.setCase_file) { await TimelineEvent0. setCase_file(relatedCase_file0); } const relatedCase_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const TimelineEvent1 = await TimelineEvents.findOne({ order: [['id', 'ASC']], offset: 1 }); if (TimelineEvent1?.setCase_file) { await TimelineEvent1. setCase_file(relatedCase_file1); } const relatedCase_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const TimelineEvent2 = await TimelineEvents.findOne({ order: [['id', 'ASC']], offset: 2 }); if (TimelineEvent2?.setCase_file) { await TimelineEvent2. setCase_file(relatedCase_file2); } } async function associateCaseArtifactWithCase_file() { const relatedCase_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const CaseArtifact0 = await CaseArtifacts.findOne({ order: [['id', 'ASC']], offset: 0 }); if (CaseArtifact0?.setCase_file) { await CaseArtifact0. setCase_file(relatedCase_file0); } const relatedCase_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const CaseArtifact1 = await CaseArtifacts.findOne({ order: [['id', 'ASC']], offset: 1 }); if (CaseArtifact1?.setCase_file) { await CaseArtifact1. setCase_file(relatedCase_file1); } const relatedCase_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const CaseArtifact2 = await CaseArtifacts.findOne({ order: [['id', 'ASC']], offset: 2 }); if (CaseArtifact2?.setCase_file) { await CaseArtifact2. setCase_file(relatedCase_file2); } } async function associateRecoveryAnalysWithCase_file() { const relatedCase_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RecoveryAnalys0 = await RecoveryAnalyses.findOne({ order: [['id', 'ASC']], offset: 0 }); if (RecoveryAnalys0?.setCase_file) { await RecoveryAnalys0. setCase_file(relatedCase_file0); } const relatedCase_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RecoveryAnalys1 = await RecoveryAnalyses.findOne({ order: [['id', 'ASC']], offset: 1 }); if (RecoveryAnalys1?.setCase_file) { await RecoveryAnalys1. setCase_file(relatedCase_file1); } const relatedCase_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RecoveryAnalys2 = await RecoveryAnalyses.findOne({ order: [['id', 'ASC']], offset: 2 }); if (RecoveryAnalys2?.setCase_file) { await RecoveryAnalys2. setCase_file(relatedCase_file2); } } async function associateRelatedCasWithFrom_case_file() { const relatedFrom_case_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas0 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 0 }); if (RelatedCas0?.setFrom_case_file) { await RelatedCas0. setFrom_case_file(relatedFrom_case_file0); } const relatedFrom_case_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas1 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 1 }); if (RelatedCas1?.setFrom_case_file) { await RelatedCas1. setFrom_case_file(relatedFrom_case_file1); } const relatedFrom_case_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas2 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 2 }); if (RelatedCas2?.setFrom_case_file) { await RelatedCas2. setFrom_case_file(relatedFrom_case_file2); } } async function associateRelatedCasWithTo_case_file() { const relatedTo_case_file0 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas0 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 0 }); if (RelatedCas0?.setTo_case_file) { await RelatedCas0. setTo_case_file(relatedTo_case_file0); } const relatedTo_case_file1 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas1 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 1 }); if (RelatedCas1?.setTo_case_file) { await RelatedCas1. setTo_case_file(relatedTo_case_file1); } const relatedTo_case_file2 = await CaseFiles.findOne({ offset: Math.floor(Math.random() * (await CaseFiles.count())), }); const RelatedCas2 = await RelatedCases.findOne({ order: [['id', 'ASC']], offset: 2 }); if (RelatedCas2?.setTo_case_file) { await RelatedCas2. setTo_case_file(relatedTo_case_file2); } } module.exports = { up: async (queryInterface, Sequelize) => { await CaseFiles.bulkCreate(CaseFilesData); await Wallets.bulkCreate(WalletsData); await TimelineEvents.bulkCreate(TimelineEventsData); await CaseArtifacts.bulkCreate(CaseArtifactsData); await RecoveryAnalyses.bulkCreate(RecoveryAnalysesData); await Tags.bulkCreate(TagsData); await RelatedCases.bulkCreate(RelatedCasesData); await Promise.all([ // Similar logic for "relation_many" await associateCaseFileWithAuthor(), // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" // Similar logic for "relation_many" await associateWalletWithCase_file(), await associateTimelineEventWithCase_file(), await associateCaseArtifactWithCase_file(), await associateRecoveryAnalysWithCase_file(), await associateRelatedCasWithFrom_case_file(), await associateRelatedCasWithTo_case_file(), ]); }, down: async (queryInterface, Sequelize) => { await queryInterface.bulkDelete('case_files', null, {}); await queryInterface.bulkDelete('wallets', null, {}); await queryInterface.bulkDelete('timeline_events', null, {}); await queryInterface.bulkDelete('case_artifacts', null, {}); await queryInterface.bulkDelete('recovery_analyses', null, {}); await queryInterface.bulkDelete('tags', null, {}); await queryInterface.bulkDelete('related_cases', null, {}); }, };