@fidelios/db 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backup-lib.d.ts +26 -0
- package/dist/backup-lib.d.ts.map +1 -0
- package/dist/backup-lib.js +498 -0
- package/dist/backup-lib.js.map +1 -0
- package/dist/backup.d.ts +2 -0
- package/dist/backup.d.ts.map +1 -0
- package/dist/backup.js +103 -0
- package/dist/backup.js.map +1 -0
- package/dist/client.d.ts +43 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +586 -0
- package/dist/client.js.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/client.test.js +120 -0
- package/dist/client.test.js.map +1 -0
- package/dist/embedded-postgres-error.d.ts +9 -0
- package/dist/embedded-postgres-error.d.ts.map +1 -0
- package/dist/embedded-postgres-error.js +73 -0
- package/dist/embedded-postgres-error.js.map +1 -0
- package/dist/embedded-postgres-error.test.d.ts +2 -0
- package/dist/embedded-postgres-error.test.d.ts.map +1 -0
- package/dist/embedded-postgres-error.test.js +25 -0
- package/dist/embedded-postgres-error.test.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +25 -0
- package/dist/migrate.js.map +1 -0
- package/dist/migration-runtime.d.ts +7 -0
- package/dist/migration-runtime.d.ts.map +1 -0
- package/dist/migration-runtime.js +157 -0
- package/dist/migration-runtime.js.map +1 -0
- package/dist/migration-status.d.ts +2 -0
- package/dist/migration-status.d.ts.map +1 -0
- package/dist/migration-status.js +55 -0
- package/dist/migration-status.js.map +1 -0
- package/dist/migrations/0000_mature_masked_marvel.sql +208 -0
- package/dist/migrations/0001_fast_northstar.sql +87 -0
- package/dist/migrations/0002_big_zaladane.sql +1 -0
- package/dist/migrations/0003_shallow_quentin_quire.sql +5 -0
- package/dist/migrations/0004_issue_identifiers.sql +28 -0
- package/dist/migrations/0005_chief_luke_cage.sql +19 -0
- package/dist/migrations/0006_overjoyed_mister_sinister.sql +36 -0
- package/dist/migrations/0007_new_quentin_quire.sql +20 -0
- package/dist/migrations/0008_amused_zzzax.sql +1 -0
- package/dist/migrations/0009_fast_jackal.sql +36 -0
- package/dist/migrations/0010_stale_justin_hammer.sql +37 -0
- package/dist/migrations/0011_windy_corsair.sql +18 -0
- package/dist/migrations/0012_perpetual_ser_duncan.sql +2 -0
- package/dist/migrations/0013_dashing_wasp.sql +4 -0
- package/dist/migrations/0014_many_mikhail_rasputin.sql +135 -0
- package/dist/migrations/0015_project_color_archived.sql +2 -0
- package/dist/migrations/0016_agent_icon.sql +1 -0
- package/dist/migrations/0017_tiresome_gabe_jones.sql +51 -0
- package/dist/migrations/0018_flat_sleepwalker.sql +26 -0
- package/dist/migrations/0019_public_victor_mancha.sql +18 -0
- package/dist/migrations/0020_white_anita_blake.sql +1 -0
- package/dist/migrations/0021_chief_vindicator.sql +1 -0
- package/dist/migrations/0022_company_brand_color.sql +1 -0
- package/dist/migrations/0023_fair_lethal_legion.sql +3 -0
- package/dist/migrations/0024_far_beast.sql +2 -0
- package/dist/migrations/0025_nasty_salo.sql +15 -0
- package/dist/migrations/0026_lying_pete_wisdom.sql +39 -0
- package/dist/migrations/0027_tranquil_tenebrous.sql +2 -0
- package/dist/migrations/0028_harsh_goliath.sql +54 -0
- package/dist/migrations/0029_plugin_tables.sql +177 -0
- package/dist/migrations/0030_rich_magneto.sql +12 -0
- package/dist/migrations/0031_zippy_magma.sql +51 -0
- package/dist/migrations/0032_pretty_doctor_octopus.sql +102 -0
- package/dist/migrations/0033_shiny_black_tarantula.sql +2 -0
- package/dist/migrations/0034_fat_dormammu.sql +2 -0
- package/dist/migrations/0035_marvelous_satana.sql +91 -0
- package/dist/migrations/0036_cheerful_nitro.sql +9 -0
- package/dist/migrations/0037_friendly_eddie_brock.sql +29 -0
- package/dist/migrations/0038_careless_iron_monger.sql +5 -0
- package/dist/migrations/0039_fat_magneto.sql +161 -0
- package/dist/migrations/0040_eager_shotgun.sql +5 -0
- package/dist/migrations/0041_curly_maria_hill.sql +1 -0
- package/dist/migrations/0042_spotty_the_renegades.sql +26 -0
- package/dist/migrations/0043_reflective_captain_universe.sql +6 -0
- package/dist/migrations/0044_illegal_toad.sql +56 -0
- package/dist/migrations/0045_workable_shockwave.sql +17 -0
- package/dist/migrations/meta/0000_snapshot.json +1743 -0
- package/dist/migrations/meta/0001_snapshot.json +2441 -0
- package/dist/migrations/meta/0002_snapshot.json +2454 -0
- package/dist/migrations/meta/0003_snapshot.json +2502 -0
- package/dist/migrations/meta/0005_snapshot.json +2719 -0
- package/dist/migrations/meta/0006_snapshot.json +3048 -0
- package/dist/migrations/meta/0007_snapshot.json +3258 -0
- package/dist/migrations/meta/0008_snapshot.json +3264 -0
- package/dist/migrations/meta/0009_snapshot.json +3587 -0
- package/dist/migrations/meta/0010_snapshot.json +3929 -0
- package/dist/migrations/meta/0011_snapshot.json +4068 -0
- package/dist/migrations/meta/0012_snapshot.json +4087 -0
- package/dist/migrations/meta/0013_snapshot.json +4118 -0
- package/dist/migrations/meta/0014_snapshot.json +5187 -0
- package/dist/migrations/meta/0017_snapshot.json +5215 -0
- package/dist/migrations/meta/0018_snapshot.json +5450 -0
- package/dist/migrations/meta/0019_snapshot.json +5603 -0
- package/dist/migrations/meta/0020_snapshot.json +5603 -0
- package/dist/migrations/meta/0021_snapshot.json +5609 -0
- package/dist/migrations/meta/0023_snapshot.json +5633 -0
- package/dist/migrations/meta/0024_snapshot.json +5693 -0
- package/dist/migrations/meta/0025_snapshot.json +5849 -0
- package/dist/migrations/meta/0027_snapshot.json +6205 -0
- package/dist/migrations/meta/0028_snapshot.json +6710 -0
- package/dist/migrations/meta/0029_snapshot.json +7899 -0
- package/dist/migrations/meta/0030_snapshot.json +8003 -0
- package/dist/migrations/meta/0031_snapshot.json +7242 -0
- package/dist/migrations/meta/0032_snapshot.json +7733 -0
- package/dist/migrations/meta/0033_snapshot.json +9038 -0
- package/dist/migrations/meta/0034_snapshot.json +9039 -0
- package/dist/migrations/meta/0035_snapshot.json +9959 -0
- package/dist/migrations/meta/0036_snapshot.json +10023 -0
- package/dist/migrations/meta/0037_snapshot.json +10263 -0
- package/dist/migrations/meta/0038_snapshot.json +11350 -0
- package/dist/migrations/meta/0039_snapshot.json +10308 -0
- package/dist/migrations/meta/0040_snapshot.json +10481 -0
- package/dist/migrations/meta/0041_snapshot.json +11393 -0
- package/dist/migrations/meta/0044_snapshot.json +11701 -0
- package/dist/migrations/meta/0045_snapshot.json +11857 -0
- package/dist/migrations/meta/_journal.json +328 -0
- package/dist/migrations/migrations/0000_mature_masked_marvel.sql +208 -0
- package/dist/migrations/migrations/0001_fast_northstar.sql +87 -0
- package/dist/migrations/migrations/0002_big_zaladane.sql +1 -0
- package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +5 -0
- package/dist/migrations/migrations/0004_issue_identifiers.sql +28 -0
- package/dist/migrations/migrations/0005_chief_luke_cage.sql +19 -0
- package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +36 -0
- package/dist/migrations/migrations/0007_new_quentin_quire.sql +20 -0
- package/dist/migrations/migrations/0008_amused_zzzax.sql +1 -0
- package/dist/migrations/migrations/0009_fast_jackal.sql +36 -0
- package/dist/migrations/migrations/0010_stale_justin_hammer.sql +37 -0
- package/dist/migrations/migrations/0011_windy_corsair.sql +18 -0
- package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +2 -0
- package/dist/migrations/migrations/0013_dashing_wasp.sql +4 -0
- package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +135 -0
- package/dist/migrations/migrations/0015_project_color_archived.sql +2 -0
- package/dist/migrations/migrations/0016_agent_icon.sql +1 -0
- package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +51 -0
- package/dist/migrations/migrations/0018_flat_sleepwalker.sql +26 -0
- package/dist/migrations/migrations/0019_public_victor_mancha.sql +18 -0
- package/dist/migrations/migrations/0020_white_anita_blake.sql +1 -0
- package/dist/migrations/migrations/0021_chief_vindicator.sql +1 -0
- package/dist/migrations/migrations/0022_company_brand_color.sql +1 -0
- package/dist/migrations/migrations/0023_fair_lethal_legion.sql +3 -0
- package/dist/migrations/migrations/0024_far_beast.sql +2 -0
- package/dist/migrations/migrations/0025_nasty_salo.sql +15 -0
- package/dist/migrations/migrations/0026_lying_pete_wisdom.sql +39 -0
- package/dist/migrations/migrations/0027_tranquil_tenebrous.sql +2 -0
- package/dist/migrations/migrations/0028_harsh_goliath.sql +54 -0
- package/dist/migrations/migrations/0029_plugin_tables.sql +177 -0
- package/dist/migrations/migrations/0030_rich_magneto.sql +12 -0
- package/dist/migrations/migrations/0031_zippy_magma.sql +51 -0
- package/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +102 -0
- package/dist/migrations/migrations/0033_shiny_black_tarantula.sql +2 -0
- package/dist/migrations/migrations/0034_fat_dormammu.sql +2 -0
- package/dist/migrations/migrations/0035_marvelous_satana.sql +91 -0
- package/dist/migrations/migrations/0036_cheerful_nitro.sql +9 -0
- package/dist/migrations/migrations/0037_friendly_eddie_brock.sql +29 -0
- package/dist/migrations/migrations/0038_careless_iron_monger.sql +5 -0
- package/dist/migrations/migrations/0039_fat_magneto.sql +161 -0
- package/dist/migrations/migrations/0040_eager_shotgun.sql +5 -0
- package/dist/migrations/migrations/0041_curly_maria_hill.sql +1 -0
- package/dist/migrations/migrations/0042_spotty_the_renegades.sql +26 -0
- package/dist/migrations/migrations/0043_reflective_captain_universe.sql +6 -0
- package/dist/migrations/migrations/0044_illegal_toad.sql +56 -0
- package/dist/migrations/migrations/0045_workable_shockwave.sql +17 -0
- package/dist/migrations/migrations/meta/0000_snapshot.json +1743 -0
- package/dist/migrations/migrations/meta/0001_snapshot.json +2441 -0
- package/dist/migrations/migrations/meta/0002_snapshot.json +2454 -0
- package/dist/migrations/migrations/meta/0003_snapshot.json +2502 -0
- package/dist/migrations/migrations/meta/0005_snapshot.json +2719 -0
- package/dist/migrations/migrations/meta/0006_snapshot.json +3048 -0
- package/dist/migrations/migrations/meta/0007_snapshot.json +3258 -0
- package/dist/migrations/migrations/meta/0008_snapshot.json +3264 -0
- package/dist/migrations/migrations/meta/0009_snapshot.json +3587 -0
- package/dist/migrations/migrations/meta/0010_snapshot.json +3929 -0
- package/dist/migrations/migrations/meta/0011_snapshot.json +4068 -0
- package/dist/migrations/migrations/meta/0012_snapshot.json +4087 -0
- package/dist/migrations/migrations/meta/0013_snapshot.json +4118 -0
- package/dist/migrations/migrations/meta/0014_snapshot.json +5187 -0
- package/dist/migrations/migrations/meta/0017_snapshot.json +5215 -0
- package/dist/migrations/migrations/meta/0018_snapshot.json +5450 -0
- package/dist/migrations/migrations/meta/0019_snapshot.json +5603 -0
- package/dist/migrations/migrations/meta/0020_snapshot.json +5603 -0
- package/dist/migrations/migrations/meta/0021_snapshot.json +5609 -0
- package/dist/migrations/migrations/meta/0023_snapshot.json +5633 -0
- package/dist/migrations/migrations/meta/0024_snapshot.json +5693 -0
- package/dist/migrations/migrations/meta/0025_snapshot.json +5849 -0
- package/dist/migrations/migrations/meta/0027_snapshot.json +6205 -0
- package/dist/migrations/migrations/meta/0028_snapshot.json +6710 -0
- package/dist/migrations/migrations/meta/0029_snapshot.json +7899 -0
- package/dist/migrations/migrations/meta/0030_snapshot.json +8003 -0
- package/dist/migrations/migrations/meta/0031_snapshot.json +7242 -0
- package/dist/migrations/migrations/meta/0032_snapshot.json +7733 -0
- package/dist/migrations/migrations/meta/0033_snapshot.json +9038 -0
- package/dist/migrations/migrations/meta/0034_snapshot.json +9039 -0
- package/dist/migrations/migrations/meta/0035_snapshot.json +9959 -0
- package/dist/migrations/migrations/meta/0036_snapshot.json +10023 -0
- package/dist/migrations/migrations/meta/0037_snapshot.json +10263 -0
- package/dist/migrations/migrations/meta/0038_snapshot.json +11350 -0
- package/dist/migrations/migrations/meta/0039_snapshot.json +10308 -0
- package/dist/migrations/migrations/meta/0040_snapshot.json +10481 -0
- package/dist/migrations/migrations/meta/0041_snapshot.json +11393 -0
- package/dist/migrations/migrations/meta/0044_snapshot.json +11701 -0
- package/dist/migrations/migrations/meta/0045_snapshot.json +11857 -0
- package/dist/migrations/migrations/meta/_journal.json +328 -0
- package/dist/restore.d.ts +2 -0
- package/dist/restore.d.ts.map +1 -0
- package/dist/restore.js +211 -0
- package/dist/restore.js.map +1 -0
- package/dist/runtime-config.d.ts +16 -0
- package/dist/runtime-config.d.ts.map +1 -0
- package/dist/runtime-config.js +197 -0
- package/dist/runtime-config.js.map +1 -0
- package/dist/runtime-config.test.d.ts +2 -0
- package/dist/runtime-config.test.d.ts.map +1 -0
- package/dist/runtime-config.test.js +93 -0
- package/dist/runtime-config.test.js.map +1 -0
- package/dist/s3-sync.d.ts +36 -0
- package/dist/s3-sync.d.ts.map +1 -0
- package/dist/s3-sync.js +120 -0
- package/dist/s3-sync.js.map +1 -0
- package/dist/schema/activity_log.d.ts +197 -0
- package/dist/schema/activity_log.d.ts.map +1 -0
- package/dist/schema/activity_log.js +22 -0
- package/dist/schema/activity_log.js.map +1 -0
- package/dist/schema/agent_api_keys.d.ts +144 -0
- package/dist/schema/agent_api_keys.d.ts.map +1 -0
- package/dist/schema/agent_api_keys.js +17 -0
- package/dist/schema/agent_api_keys.js.map +1 -0
- package/dist/schema/agent_config_revisions.d.ts +201 -0
- package/dist/schema/agent_config_revisions.d.ts.map +1 -0
- package/dist/schema/agent_config_revisions.js +20 -0
- package/dist/schema/agent_config_revisions.js.map +1 -0
- package/dist/schema/agent_runtime_state.d.ts +248 -0
- package/dist/schema/agent_runtime_state.d.ts.map +1 -0
- package/dist/schema/agent_runtime_state.js +23 -0
- package/dist/schema/agent_runtime_state.js.map +1 -0
- package/dist/schema/agent_task_sessions.d.ts +197 -0
- package/dist/schema/agent_task_sessions.d.ts.map +1 -0
- package/dist/schema/agent_task_sessions.js +22 -0
- package/dist/schema/agent_task_sessions.js.map +1 -0
- package/dist/schema/agent_wakeup_requests.d.ts +333 -0
- package/dist/schema/agent_wakeup_requests.d.ts.map +1 -0
- package/dist/schema/agent_wakeup_requests.js +29 -0
- package/dist/schema/agent_wakeup_requests.js.map +1 -0
- package/dist/schema/agents.d.ts +373 -0
- package/dist/schema/agents.d.ts.map +1 -0
- package/dist/schema/agents.js +29 -0
- package/dist/schema/agents.js.map +1 -0
- package/dist/schema/approval_comments.d.ts +144 -0
- package/dist/schema/approval_comments.d.ts.map +1 -0
- package/dist/schema/approval_comments.js +19 -0
- package/dist/schema/approval_comments.js.map +1 -0
- package/dist/schema/approvals.d.ts +214 -0
- package/dist/schema/approvals.d.ts.map +1 -0
- package/dist/schema/approvals.js +20 -0
- package/dist/schema/approvals.js.map +1 -0
- package/dist/schema/assets.d.ts +212 -0
- package/dist/schema/assets.d.ts.map +1 -0
- package/dist/schema/assets.js +22 -0
- package/dist/schema/assets.js.map +1 -0
- package/dist/schema/auth.d.ts +607 -0
- package/dist/schema/auth.d.ts.map +1 -0
- package/dist/schema/auth.js +44 -0
- package/dist/schema/auth.js.map +1 -0
- package/dist/schema/board_api_keys.d.ts +144 -0
- package/dist/schema/board_api_keys.d.ts.map +1 -0
- package/dist/schema/board_api_keys.js +16 -0
- package/dist/schema/board_api_keys.js.map +1 -0
- package/dist/schema/budget_incidents.d.ts +297 -0
- package/dist/schema/budget_incidents.d.ts.map +1 -0
- package/dist/schema/budget_incidents.js +29 -0
- package/dist/schema/budget_incidents.js.map +1 -0
- package/dist/schema/budget_policies.d.ts +263 -0
- package/dist/schema/budget_policies.d.ts.map +1 -0
- package/dist/schema/budget_policies.js +24 -0
- package/dist/schema/budget_policies.js.map +1 -0
- package/dist/schema/cli_auth_challenges.d.ts +263 -0
- package/dist/schema/cli_auth_challenges.d.ts.map +1 -0
- package/dist/schema/cli_auth_challenges.js +26 -0
- package/dist/schema/cli_auth_challenges.js.map +1 -0
- package/dist/schema/companies.d.ts +246 -0
- package/dist/schema/companies.d.ts.map +1 -0
- package/dist/schema/companies.js +22 -0
- package/dist/schema/companies.js.map +1 -0
- package/dist/schema/company_logos.d.ts +93 -0
- package/dist/schema/company_logos.d.ts.map +1 -0
- package/dist/schema/company_logos.js +14 -0
- package/dist/schema/company_logos.js.map +1 -0
- package/dist/schema/company_memberships.d.ts +144 -0
- package/dist/schema/company_memberships.d.ts.map +1 -0
- package/dist/schema/company_memberships.js +17 -0
- package/dist/schema/company_memberships.js.map +1 -0
- package/dist/schema/company_secret_versions.d.ts +163 -0
- package/dist/schema/company_secret_versions.d.ts.map +1 -0
- package/dist/schema/company_secret_versions.js +19 -0
- package/dist/schema/company_secret_versions.js.map +1 -0
- package/dist/schema/company_secrets.d.ts +195 -0
- package/dist/schema/company_secrets.d.ts.map +1 -0
- package/dist/schema/company_secrets.js +21 -0
- package/dist/schema/company_secrets.js.map +1 -0
- package/dist/schema/company_skills.d.ts +284 -0
- package/dist/schema/company_skills.d.ts.map +1 -0
- package/dist/schema/company_skills.js +24 -0
- package/dist/schema/company_skills.js.map +1 -0
- package/dist/schema/cost_events.d.ts +314 -0
- package/dist/schema/cost_events.d.ts.map +1 -0
- package/dist/schema/cost_events.js +34 -0
- package/dist/schema/cost_events.js.map +1 -0
- package/dist/schema/document_revisions.d.ts +161 -0
- package/dist/schema/document_revisions.d.ts.map +1 -0
- package/dist/schema/document_revisions.js +19 -0
- package/dist/schema/document_revisions.js.map +1 -0
- package/dist/schema/documents.d.ts +229 -0
- package/dist/schema/documents.d.ts.map +1 -0
- package/dist/schema/documents.js +22 -0
- package/dist/schema/documents.js.map +1 -0
- package/dist/schema/execution_workspaces.d.ts +418 -0
- package/dist/schema/execution_workspaces.d.ts.map +1 -0
- package/dist/schema/execution_workspaces.js +39 -0
- package/dist/schema/execution_workspaces.js.map +1 -0
- package/dist/schema/finance_events.d.ts +469 -0
- package/dist/schema/finance_events.d.ts.map +1 -0
- package/dist/schema/finance_events.js +45 -0
- package/dist/schema/finance_events.js.map +1 -0
- package/dist/schema/goals.d.ts +178 -0
- package/dist/schema/goals.d.ts.map +1 -0
- package/dist/schema/goals.js +18 -0
- package/dist/schema/goals.js.map +1 -0
- package/dist/schema/heartbeat_run_events.d.ts +214 -0
- package/dist/schema/heartbeat_run_events.d.ts.map +1 -0
- package/dist/schema/heartbeat_run_events.js +23 -0
- package/dist/schema/heartbeat_run_events.js.map +1 -0
- package/dist/schema/heartbeat_runs.d.ts +558 -0
- package/dist/schema/heartbeat_runs.d.ts.map +1 -0
- package/dist/schema/heartbeat_runs.js +43 -0
- package/dist/schema/heartbeat_runs.js.map +1 -0
- package/dist/schema/index.d.ts +59 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +59 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/instance_settings.d.ts +114 -0
- package/dist/schema/instance_settings.d.ts.map +1 -0
- package/dist/schema/instance_settings.js +12 -0
- package/dist/schema/instance_settings.js.map +1 -0
- package/dist/schema/instance_user_roles.d.ts +93 -0
- package/dist/schema/instance_user_roles.d.ts.map +1 -0
- package/dist/schema/instance_user_roles.js +12 -0
- package/dist/schema/instance_user_roles.js.map +1 -0
- package/dist/schema/invites.d.ts +214 -0
- package/dist/schema/invites.d.ts.map +1 -0
- package/dist/schema/invites.js +20 -0
- package/dist/schema/invites.js.map +1 -0
- package/dist/schema/issue_approvals.d.ts +110 -0
- package/dist/schema/issue_approvals.d.ts.map +1 -0
- package/dist/schema/issue_approvals.js +19 -0
- package/dist/schema/issue_approvals.js.map +1 -0
- package/dist/schema/issue_attachments.d.ts +127 -0
- package/dist/schema/issue_attachments.d.ts.map +1 -0
- package/dist/schema/issue_attachments.js +19 -0
- package/dist/schema/issue_attachments.js.map +1 -0
- package/dist/schema/issue_comments.d.ts +144 -0
- package/dist/schema/issue_comments.d.ts.map +1 -0
- package/dist/schema/issue_comments.js +20 -0
- package/dist/schema/issue_comments.js.map +1 -0
- package/dist/schema/issue_documents.d.ts +127 -0
- package/dist/schema/issue_documents.d.ts.map +1 -0
- package/dist/schema/issue_documents.js +18 -0
- package/dist/schema/issue_documents.js.map +1 -0
- package/dist/schema/issue_inbox_archives.d.ts +127 -0
- package/dist/schema/issue_inbox_archives.d.ts.map +1 -0
- package/dist/schema/issue_inbox_archives.js +17 -0
- package/dist/schema/issue_inbox_archives.js.map +1 -0
- package/dist/schema/issue_labels.d.ts +76 -0
- package/dist/schema/issue_labels.d.ts.map +1 -0
- package/dist/schema/issue_labels.js +16 -0
- package/dist/schema/issue_labels.js.map +1 -0
- package/dist/schema/issue_read_states.d.ts +127 -0
- package/dist/schema/issue_read_states.d.ts.map +1 -0
- package/dist/schema/issue_read_states.js +17 -0
- package/dist/schema/issue_read_states.js.map +1 -0
- package/dist/schema/issue_work_products.d.ts +350 -0
- package/dist/schema/issue_work_products.d.ts.map +1 -0
- package/dist/schema/issue_work_products.js +37 -0
- package/dist/schema/issue_work_products.js.map +1 -0
- package/dist/schema/issues.d.ts +607 -0
- package/dist/schema/issues.d.ts.map +1 -0
- package/dist/schema/issues.js +65 -0
- package/dist/schema/issues.js.map +1 -0
- package/dist/schema/join_requests.d.ts +384 -0
- package/dist/schema/join_requests.d.ts.map +1 -0
- package/dist/schema/join_requests.js +32 -0
- package/dist/schema/join_requests.js.map +1 -0
- package/dist/schema/labels.d.ts +110 -0
- package/dist/schema/labels.d.ts.map +1 -0
- package/dist/schema/labels.js +14 -0
- package/dist/schema/labels.js.map +1 -0
- package/dist/schema/plugin_company_settings.d.ts +158 -0
- package/dist/schema/plugin_company_settings.d.ts.map +1 -0
- package/dist/schema/plugin_company_settings.js +34 -0
- package/dist/schema/plugin_company_settings.js.map +1 -0
- package/dist/schema/plugin_config.d.ts +123 -0
- package/dist/schema/plugin_config.d.ts.map +1 -0
- package/dist/schema/plugin_config.js +26 -0
- package/dist/schema/plugin_config.js.map +1 -0
- package/dist/schema/plugin_entities.d.ts +213 -0
- package/dist/schema/plugin_entities.d.ts.map +1 -0
- package/dist/schema/plugin_entities.js +37 -0
- package/dist/schema/plugin_entities.js.map +1 -0
- package/dist/schema/plugin_jobs.d.ts +392 -0
- package/dist/schema/plugin_jobs.d.ts.map +1 -0
- package/dist/schema/plugin_jobs.js +83 -0
- package/dist/schema/plugin_jobs.js.map +1 -0
- package/dist/schema/plugin_logs.d.ts +125 -0
- package/dist/schema/plugin_logs.d.ts.map +1 -0
- package/dist/schema/plugin_logs.js +29 -0
- package/dist/schema/plugin_logs.js.map +1 -0
- package/dist/schema/plugin_state.d.ts +169 -0
- package/dist/schema/plugin_state.d.ts.map +1 -0
- package/dist/schema/plugin_state.js +68 -0
- package/dist/schema/plugin_state.js.map +1 -0
- package/dist/schema/plugin_webhooks.d.ts +239 -0
- package/dist/schema/plugin_webhooks.d.ts.map +1 -0
- package/dist/schema/plugin_webhooks.js +52 -0
- package/dist/schema/plugin_webhooks.js.map +1 -0
- package/dist/schema/plugins.d.ts +246 -0
- package/dist/schema/plugins.d.ts.map +1 -0
- package/dist/schema/plugins.js +31 -0
- package/dist/schema/plugins.js.map +1 -0
- package/dist/schema/principal_permission_grants.d.ts +163 -0
- package/dist/schema/principal_permission_grants.d.ts.map +1 -0
- package/dist/schema/principal_permission_grants.js +17 -0
- package/dist/schema/principal_permission_grants.js.map +1 -0
- package/dist/schema/project_goals.d.ts +93 -0
- package/dist/schema/project_goals.d.ts.map +1 -0
- package/dist/schema/project_goals.js +17 -0
- package/dist/schema/project_goals.js.map +1 -0
- package/dist/schema/project_workspaces.d.ts +333 -0
- package/dist/schema/project_workspaces.d.ts.map +1 -0
- package/dist/schema/project_workspaces.js +32 -0
- package/dist/schema/project_workspaces.js.map +1 -0
- package/dist/schema/projects.d.ts +265 -0
- package/dist/schema/projects.d.ts.map +1 -0
- package/dist/schema/projects.js +24 -0
- package/dist/schema/projects.js.map +1 -0
- package/dist/schema/routines.d.ts +993 -0
- package/dist/schema/routines.d.ts.map +1 -0
- package/dist/schema/routines.js +86 -0
- package/dist/schema/routines.js.map +1 -0
- package/dist/schema/workspace_operations.d.ts +367 -0
- package/dist/schema/workspace_operations.d.ts.map +1 -0
- package/dist/schema/workspace_operations.js +35 -0
- package/dist/schema/workspace_operations.js.map +1 -0
- package/dist/schema/workspace_runtime_services.d.ts +469 -0
- package/dist/schema/workspace_runtime_services.d.ts.map +1 -0
- package/dist/schema/workspace_runtime_services.js +44 -0
- package/dist/schema/workspace_runtime_services.js.map +1 -0
- package/dist/seed.d.ts +2 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +91 -0
- package/dist/seed.js.map +1 -0
- package/dist/test-embedded-postgres.d.ts +11 -0
- package/dist/test-embedded-postgres.d.ts.map +1 -0
- package/dist/test-embedded-postgres.js +110 -0
- package/dist/test-embedded-postgres.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
-- Rollback:
|
|
2
|
+
-- DROP INDEX IF EXISTS "plugin_logs_level_idx";
|
|
3
|
+
-- DROP INDEX IF EXISTS "plugin_logs_plugin_time_idx";
|
|
4
|
+
-- DROP INDEX IF EXISTS "plugin_company_settings_company_plugin_uq";
|
|
5
|
+
-- DROP INDEX IF EXISTS "plugin_company_settings_plugin_idx";
|
|
6
|
+
-- DROP INDEX IF EXISTS "plugin_company_settings_company_idx";
|
|
7
|
+
-- DROP INDEX IF EXISTS "plugin_webhook_deliveries_key_idx";
|
|
8
|
+
-- DROP INDEX IF EXISTS "plugin_webhook_deliveries_status_idx";
|
|
9
|
+
-- DROP INDEX IF EXISTS "plugin_webhook_deliveries_plugin_idx";
|
|
10
|
+
-- DROP INDEX IF EXISTS "plugin_job_runs_status_idx";
|
|
11
|
+
-- DROP INDEX IF EXISTS "plugin_job_runs_plugin_idx";
|
|
12
|
+
-- DROP INDEX IF EXISTS "plugin_job_runs_job_idx";
|
|
13
|
+
-- DROP INDEX IF EXISTS "plugin_jobs_unique_idx";
|
|
14
|
+
-- DROP INDEX IF EXISTS "plugin_jobs_next_run_idx";
|
|
15
|
+
-- DROP INDEX IF EXISTS "plugin_jobs_plugin_idx";
|
|
16
|
+
-- DROP INDEX IF EXISTS "plugin_entities_external_idx";
|
|
17
|
+
-- DROP INDEX IF EXISTS "plugin_entities_scope_idx";
|
|
18
|
+
-- DROP INDEX IF EXISTS "plugin_entities_type_idx";
|
|
19
|
+
-- DROP INDEX IF EXISTS "plugin_entities_plugin_idx";
|
|
20
|
+
-- DROP INDEX IF EXISTS "plugin_state_plugin_scope_idx";
|
|
21
|
+
-- DROP INDEX IF EXISTS "plugin_config_plugin_id_idx";
|
|
22
|
+
-- DROP INDEX IF EXISTS "plugins_status_idx";
|
|
23
|
+
-- DROP INDEX IF EXISTS "plugins_plugin_key_idx";
|
|
24
|
+
-- DROP TABLE IF EXISTS "plugin_logs";
|
|
25
|
+
-- DROP TABLE IF EXISTS "plugin_company_settings";
|
|
26
|
+
-- DROP TABLE IF EXISTS "plugin_webhook_deliveries";
|
|
27
|
+
-- DROP TABLE IF EXISTS "plugin_job_runs";
|
|
28
|
+
-- DROP TABLE IF EXISTS "plugin_jobs";
|
|
29
|
+
-- DROP TABLE IF EXISTS "plugin_entities";
|
|
30
|
+
-- DROP TABLE IF EXISTS "plugin_state";
|
|
31
|
+
-- DROP TABLE IF EXISTS "plugin_config";
|
|
32
|
+
-- DROP TABLE IF EXISTS "plugins";
|
|
33
|
+
|
|
34
|
+
CREATE TABLE "plugins" (
|
|
35
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
36
|
+
"plugin_key" text NOT NULL,
|
|
37
|
+
"package_name" text NOT NULL,
|
|
38
|
+
"package_path" text,
|
|
39
|
+
"version" text NOT NULL,
|
|
40
|
+
"api_version" integer DEFAULT 1 NOT NULL,
|
|
41
|
+
"categories" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
42
|
+
"manifest_json" jsonb NOT NULL,
|
|
43
|
+
"status" text DEFAULT 'installed' NOT NULL,
|
|
44
|
+
"install_order" integer,
|
|
45
|
+
"last_error" text,
|
|
46
|
+
"installed_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
47
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
48
|
+
);
|
|
49
|
+
--> statement-breakpoint
|
|
50
|
+
CREATE TABLE "plugin_config" (
|
|
51
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
52
|
+
"plugin_id" uuid NOT NULL,
|
|
53
|
+
"config_json" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
54
|
+
"last_error" text,
|
|
55
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
56
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
57
|
+
);
|
|
58
|
+
--> statement-breakpoint
|
|
59
|
+
CREATE TABLE "plugin_state" (
|
|
60
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
61
|
+
"plugin_id" uuid NOT NULL,
|
|
62
|
+
"scope_kind" text NOT NULL,
|
|
63
|
+
"scope_id" text,
|
|
64
|
+
"namespace" text DEFAULT 'default' NOT NULL,
|
|
65
|
+
"state_key" text NOT NULL,
|
|
66
|
+
"value_json" jsonb NOT NULL,
|
|
67
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
68
|
+
CONSTRAINT "plugin_state_unique_entry_idx" UNIQUE NULLS NOT DISTINCT("plugin_id","scope_kind","scope_id","namespace","state_key")
|
|
69
|
+
);
|
|
70
|
+
--> statement-breakpoint
|
|
71
|
+
CREATE TABLE "plugin_entities" (
|
|
72
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
73
|
+
"plugin_id" uuid NOT NULL,
|
|
74
|
+
"entity_type" text NOT NULL,
|
|
75
|
+
"scope_kind" text NOT NULL,
|
|
76
|
+
"scope_id" text,
|
|
77
|
+
"external_id" text,
|
|
78
|
+
"title" text,
|
|
79
|
+
"status" text,
|
|
80
|
+
"data" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
81
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
82
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
83
|
+
);
|
|
84
|
+
--> statement-breakpoint
|
|
85
|
+
CREATE TABLE "plugin_jobs" (
|
|
86
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
87
|
+
"plugin_id" uuid NOT NULL,
|
|
88
|
+
"job_key" text NOT NULL,
|
|
89
|
+
"schedule" text NOT NULL,
|
|
90
|
+
"status" text DEFAULT 'active' NOT NULL,
|
|
91
|
+
"last_run_at" timestamp with time zone,
|
|
92
|
+
"next_run_at" timestamp with time zone,
|
|
93
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
94
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
95
|
+
);
|
|
96
|
+
--> statement-breakpoint
|
|
97
|
+
CREATE TABLE "plugin_job_runs" (
|
|
98
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
99
|
+
"job_id" uuid NOT NULL,
|
|
100
|
+
"plugin_id" uuid NOT NULL,
|
|
101
|
+
"trigger" text NOT NULL,
|
|
102
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
103
|
+
"duration_ms" integer,
|
|
104
|
+
"error" text,
|
|
105
|
+
"logs" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
106
|
+
"started_at" timestamp with time zone,
|
|
107
|
+
"finished_at" timestamp with time zone,
|
|
108
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
109
|
+
);
|
|
110
|
+
--> statement-breakpoint
|
|
111
|
+
CREATE TABLE "plugin_webhook_deliveries" (
|
|
112
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
113
|
+
"plugin_id" uuid NOT NULL,
|
|
114
|
+
"webhook_key" text NOT NULL,
|
|
115
|
+
"external_id" text,
|
|
116
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
117
|
+
"duration_ms" integer,
|
|
118
|
+
"error" text,
|
|
119
|
+
"payload" jsonb NOT NULL,
|
|
120
|
+
"headers" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
121
|
+
"started_at" timestamp with time zone,
|
|
122
|
+
"finished_at" timestamp with time zone,
|
|
123
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
124
|
+
);
|
|
125
|
+
--> statement-breakpoint
|
|
126
|
+
CREATE TABLE "plugin_company_settings" (
|
|
127
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
128
|
+
"company_id" uuid NOT NULL,
|
|
129
|
+
"plugin_id" uuid NOT NULL,
|
|
130
|
+
"settings_json" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
131
|
+
"last_error" text,
|
|
132
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
133
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
134
|
+
"enabled" boolean DEFAULT true NOT NULL
|
|
135
|
+
);
|
|
136
|
+
--> statement-breakpoint
|
|
137
|
+
CREATE TABLE "plugin_logs" (
|
|
138
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
139
|
+
"plugin_id" uuid NOT NULL,
|
|
140
|
+
"level" text NOT NULL DEFAULT 'info',
|
|
141
|
+
"message" text NOT NULL,
|
|
142
|
+
"meta" jsonb,
|
|
143
|
+
"created_at" timestamp with time zone NOT NULL DEFAULT now()
|
|
144
|
+
);
|
|
145
|
+
--> statement-breakpoint
|
|
146
|
+
ALTER TABLE "plugin_config" ADD CONSTRAINT "plugin_config_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
147
|
+
ALTER TABLE "plugin_state" ADD CONSTRAINT "plugin_state_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
148
|
+
ALTER TABLE "plugin_entities" ADD CONSTRAINT "plugin_entities_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
149
|
+
ALTER TABLE "plugin_jobs" ADD CONSTRAINT "plugin_jobs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
150
|
+
ALTER TABLE "plugin_job_runs" ADD CONSTRAINT "plugin_job_runs_job_id_plugin_jobs_id_fk" FOREIGN KEY ("job_id") REFERENCES "public"."plugin_jobs"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
151
|
+
ALTER TABLE "plugin_job_runs" ADD CONSTRAINT "plugin_job_runs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
152
|
+
ALTER TABLE "plugin_webhook_deliveries" ADD CONSTRAINT "plugin_webhook_deliveries_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
153
|
+
ALTER TABLE "plugin_company_settings" ADD CONSTRAINT "plugin_company_settings_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
154
|
+
ALTER TABLE "plugin_company_settings" ADD CONSTRAINT "plugin_company_settings_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
155
|
+
ALTER TABLE "plugin_logs" ADD CONSTRAINT "plugin_logs_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
156
|
+
CREATE UNIQUE INDEX "plugins_plugin_key_idx" ON "plugins" USING btree ("plugin_key");--> statement-breakpoint
|
|
157
|
+
CREATE INDEX "plugins_status_idx" ON "plugins" USING btree ("status");--> statement-breakpoint
|
|
158
|
+
CREATE UNIQUE INDEX "plugin_config_plugin_id_idx" ON "plugin_config" USING btree ("plugin_id");--> statement-breakpoint
|
|
159
|
+
CREATE INDEX "plugin_state_plugin_scope_idx" ON "plugin_state" USING btree ("plugin_id","scope_kind");--> statement-breakpoint
|
|
160
|
+
CREATE INDEX "plugin_entities_plugin_idx" ON "plugin_entities" USING btree ("plugin_id");--> statement-breakpoint
|
|
161
|
+
CREATE INDEX "plugin_entities_type_idx" ON "plugin_entities" USING btree ("entity_type");--> statement-breakpoint
|
|
162
|
+
CREATE INDEX "plugin_entities_scope_idx" ON "plugin_entities" USING btree ("scope_kind","scope_id");--> statement-breakpoint
|
|
163
|
+
CREATE UNIQUE INDEX "plugin_entities_external_idx" ON "plugin_entities" USING btree ("plugin_id","entity_type","external_id");--> statement-breakpoint
|
|
164
|
+
CREATE INDEX "plugin_jobs_plugin_idx" ON "plugin_jobs" USING btree ("plugin_id");--> statement-breakpoint
|
|
165
|
+
CREATE INDEX "plugin_jobs_next_run_idx" ON "plugin_jobs" USING btree ("next_run_at");--> statement-breakpoint
|
|
166
|
+
CREATE UNIQUE INDEX "plugin_jobs_unique_idx" ON "plugin_jobs" USING btree ("plugin_id","job_key");--> statement-breakpoint
|
|
167
|
+
CREATE INDEX "plugin_job_runs_job_idx" ON "plugin_job_runs" USING btree ("job_id");--> statement-breakpoint
|
|
168
|
+
CREATE INDEX "plugin_job_runs_plugin_idx" ON "plugin_job_runs" USING btree ("plugin_id");--> statement-breakpoint
|
|
169
|
+
CREATE INDEX "plugin_job_runs_status_idx" ON "plugin_job_runs" USING btree ("status");--> statement-breakpoint
|
|
170
|
+
CREATE INDEX "plugin_webhook_deliveries_plugin_idx" ON "plugin_webhook_deliveries" USING btree ("plugin_id");--> statement-breakpoint
|
|
171
|
+
CREATE INDEX "plugin_webhook_deliveries_status_idx" ON "plugin_webhook_deliveries" USING btree ("status");--> statement-breakpoint
|
|
172
|
+
CREATE INDEX "plugin_webhook_deliveries_key_idx" ON "plugin_webhook_deliveries" USING btree ("webhook_key");--> statement-breakpoint
|
|
173
|
+
CREATE INDEX "plugin_company_settings_company_idx" ON "plugin_company_settings" USING btree ("company_id");--> statement-breakpoint
|
|
174
|
+
CREATE INDEX "plugin_company_settings_plugin_idx" ON "plugin_company_settings" USING btree ("plugin_id");--> statement-breakpoint
|
|
175
|
+
CREATE UNIQUE INDEX "plugin_company_settings_company_plugin_uq" ON "plugin_company_settings" USING btree ("company_id","plugin_id");--> statement-breakpoint
|
|
176
|
+
CREATE INDEX "plugin_logs_plugin_time_idx" ON "plugin_logs" USING btree ("plugin_id","created_at");--> statement-breakpoint
|
|
177
|
+
CREATE INDEX "plugin_logs_level_idx" ON "plugin_logs" USING btree ("level");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
CREATE TABLE "company_logos" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"company_id" uuid NOT NULL,
|
|
4
|
+
"asset_id" uuid NOT NULL,
|
|
5
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
6
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "company_logos" ADD CONSTRAINT "company_logos_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "company_logos" ADD CONSTRAINT "company_logos_asset_id_assets_id_fk" FOREIGN KEY ("asset_id") REFERENCES "public"."assets"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
11
|
+
CREATE UNIQUE INDEX "company_logos_company_uq" ON "company_logos" USING btree ("company_id");--> statement-breakpoint
|
|
12
|
+
CREATE UNIQUE INDEX "company_logos_asset_uq" ON "company_logos" USING btree ("asset_id");
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
CREATE TABLE "finance_events" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"company_id" uuid NOT NULL,
|
|
4
|
+
"agent_id" uuid,
|
|
5
|
+
"issue_id" uuid,
|
|
6
|
+
"project_id" uuid,
|
|
7
|
+
"goal_id" uuid,
|
|
8
|
+
"heartbeat_run_id" uuid,
|
|
9
|
+
"cost_event_id" uuid,
|
|
10
|
+
"billing_code" text,
|
|
11
|
+
"description" text,
|
|
12
|
+
"event_kind" text NOT NULL,
|
|
13
|
+
"direction" text DEFAULT 'debit' NOT NULL,
|
|
14
|
+
"biller" text NOT NULL,
|
|
15
|
+
"provider" text,
|
|
16
|
+
"execution_adapter_type" text,
|
|
17
|
+
"pricing_tier" text,
|
|
18
|
+
"region" text,
|
|
19
|
+
"model" text,
|
|
20
|
+
"quantity" integer,
|
|
21
|
+
"unit" text,
|
|
22
|
+
"amount_cents" integer NOT NULL,
|
|
23
|
+
"currency" text DEFAULT 'USD' NOT NULL,
|
|
24
|
+
"estimated" boolean DEFAULT false NOT NULL,
|
|
25
|
+
"external_invoice_id" text,
|
|
26
|
+
"metadata_json" jsonb,
|
|
27
|
+
"occurred_at" timestamp with time zone NOT NULL,
|
|
28
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
29
|
+
);
|
|
30
|
+
--> statement-breakpoint
|
|
31
|
+
ALTER TABLE "cost_events" ADD COLUMN "heartbeat_run_id" uuid;--> statement-breakpoint
|
|
32
|
+
ALTER TABLE "cost_events" ADD COLUMN "biller" text DEFAULT 'unknown' NOT NULL;--> statement-breakpoint
|
|
33
|
+
ALTER TABLE "cost_events" ADD COLUMN "billing_type" text DEFAULT 'unknown' NOT NULL;--> statement-breakpoint
|
|
34
|
+
ALTER TABLE "cost_events" ADD COLUMN "cached_input_tokens" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
|
35
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
36
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_agent_id_agents_id_fk" FOREIGN KEY ("agent_id") REFERENCES "public"."agents"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
37
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_issue_id_issues_id_fk" FOREIGN KEY ("issue_id") REFERENCES "public"."issues"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
38
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
39
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_goal_id_goals_id_fk" FOREIGN KEY ("goal_id") REFERENCES "public"."goals"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
40
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
41
|
+
ALTER TABLE "finance_events" ADD CONSTRAINT "finance_events_cost_event_id_cost_events_id_fk" FOREIGN KEY ("cost_event_id") REFERENCES "public"."cost_events"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
42
|
+
CREATE INDEX "finance_events_company_occurred_idx" ON "finance_events" USING btree ("company_id","occurred_at");--> statement-breakpoint
|
|
43
|
+
CREATE INDEX "finance_events_company_biller_occurred_idx" ON "finance_events" USING btree ("company_id","biller","occurred_at");--> statement-breakpoint
|
|
44
|
+
CREATE INDEX "finance_events_company_kind_occurred_idx" ON "finance_events" USING btree ("company_id","event_kind","occurred_at");--> statement-breakpoint
|
|
45
|
+
CREATE INDEX "finance_events_company_direction_occurred_idx" ON "finance_events" USING btree ("company_id","direction","occurred_at");--> statement-breakpoint
|
|
46
|
+
CREATE INDEX "finance_events_company_heartbeat_run_idx" ON "finance_events" USING btree ("company_id","heartbeat_run_id");--> statement-breakpoint
|
|
47
|
+
CREATE INDEX "finance_events_company_cost_event_idx" ON "finance_events" USING btree ("company_id","cost_event_id");--> statement-breakpoint
|
|
48
|
+
ALTER TABLE "cost_events" ADD CONSTRAINT "cost_events_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
49
|
+
CREATE INDEX "cost_events_company_provider_occurred_idx" ON "cost_events" USING btree ("company_id","provider","occurred_at");--> statement-breakpoint
|
|
50
|
+
CREATE INDEX "cost_events_company_biller_occurred_idx" ON "cost_events" USING btree ("company_id","biller","occurred_at");--> statement-breakpoint
|
|
51
|
+
CREATE INDEX "cost_events_company_heartbeat_run_idx" ON "cost_events" USING btree ("company_id","heartbeat_run_id");
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
CREATE TABLE "budget_incidents" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"company_id" uuid NOT NULL,
|
|
4
|
+
"policy_id" uuid NOT NULL,
|
|
5
|
+
"scope_type" text NOT NULL,
|
|
6
|
+
"scope_id" uuid NOT NULL,
|
|
7
|
+
"metric" text NOT NULL,
|
|
8
|
+
"window_kind" text NOT NULL,
|
|
9
|
+
"window_start" timestamp with time zone NOT NULL,
|
|
10
|
+
"window_end" timestamp with time zone NOT NULL,
|
|
11
|
+
"threshold_type" text NOT NULL,
|
|
12
|
+
"amount_limit" integer NOT NULL,
|
|
13
|
+
"amount_observed" integer NOT NULL,
|
|
14
|
+
"status" text DEFAULT 'open' NOT NULL,
|
|
15
|
+
"approval_id" uuid,
|
|
16
|
+
"resolved_at" timestamp with time zone,
|
|
17
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
18
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
19
|
+
);
|
|
20
|
+
--> statement-breakpoint
|
|
21
|
+
CREATE TABLE "budget_policies" (
|
|
22
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
23
|
+
"company_id" uuid NOT NULL,
|
|
24
|
+
"scope_type" text NOT NULL,
|
|
25
|
+
"scope_id" uuid NOT NULL,
|
|
26
|
+
"metric" text DEFAULT 'billed_cents' NOT NULL,
|
|
27
|
+
"window_kind" text NOT NULL,
|
|
28
|
+
"amount" integer DEFAULT 0 NOT NULL,
|
|
29
|
+
"warn_percent" integer DEFAULT 80 NOT NULL,
|
|
30
|
+
"hard_stop_enabled" boolean DEFAULT true NOT NULL,
|
|
31
|
+
"notify_enabled" boolean DEFAULT true NOT NULL,
|
|
32
|
+
"is_active" boolean DEFAULT true NOT NULL,
|
|
33
|
+
"created_by_user_id" text,
|
|
34
|
+
"updated_by_user_id" text,
|
|
35
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
36
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
37
|
+
);
|
|
38
|
+
--> statement-breakpoint
|
|
39
|
+
ALTER TABLE "agents" ADD COLUMN "pause_reason" text;--> statement-breakpoint
|
|
40
|
+
ALTER TABLE "agents" ADD COLUMN "paused_at" timestamp with time zone;--> statement-breakpoint
|
|
41
|
+
ALTER TABLE "projects" ADD COLUMN "pause_reason" text;--> statement-breakpoint
|
|
42
|
+
ALTER TABLE "projects" ADD COLUMN "paused_at" timestamp with time zone;--> statement-breakpoint
|
|
43
|
+
INSERT INTO "budget_policies" (
|
|
44
|
+
"company_id",
|
|
45
|
+
"scope_type",
|
|
46
|
+
"scope_id",
|
|
47
|
+
"metric",
|
|
48
|
+
"window_kind",
|
|
49
|
+
"amount",
|
|
50
|
+
"warn_percent",
|
|
51
|
+
"hard_stop_enabled",
|
|
52
|
+
"notify_enabled",
|
|
53
|
+
"is_active"
|
|
54
|
+
)
|
|
55
|
+
SELECT
|
|
56
|
+
"id",
|
|
57
|
+
'company',
|
|
58
|
+
"id",
|
|
59
|
+
'billed_cents',
|
|
60
|
+
'calendar_month_utc',
|
|
61
|
+
"budget_monthly_cents",
|
|
62
|
+
80,
|
|
63
|
+
true,
|
|
64
|
+
true,
|
|
65
|
+
true
|
|
66
|
+
FROM "companies"
|
|
67
|
+
WHERE "budget_monthly_cents" > 0;--> statement-breakpoint
|
|
68
|
+
INSERT INTO "budget_policies" (
|
|
69
|
+
"company_id",
|
|
70
|
+
"scope_type",
|
|
71
|
+
"scope_id",
|
|
72
|
+
"metric",
|
|
73
|
+
"window_kind",
|
|
74
|
+
"amount",
|
|
75
|
+
"warn_percent",
|
|
76
|
+
"hard_stop_enabled",
|
|
77
|
+
"notify_enabled",
|
|
78
|
+
"is_active"
|
|
79
|
+
)
|
|
80
|
+
SELECT
|
|
81
|
+
"company_id",
|
|
82
|
+
'agent',
|
|
83
|
+
"id",
|
|
84
|
+
'billed_cents',
|
|
85
|
+
'calendar_month_utc',
|
|
86
|
+
"budget_monthly_cents",
|
|
87
|
+
80,
|
|
88
|
+
true,
|
|
89
|
+
true,
|
|
90
|
+
true
|
|
91
|
+
FROM "agents"
|
|
92
|
+
WHERE "budget_monthly_cents" > 0;--> statement-breakpoint
|
|
93
|
+
ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
94
|
+
ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_policy_id_budget_policies_id_fk" FOREIGN KEY ("policy_id") REFERENCES "public"."budget_policies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
95
|
+
ALTER TABLE "budget_incidents" ADD CONSTRAINT "budget_incidents_approval_id_approvals_id_fk" FOREIGN KEY ("approval_id") REFERENCES "public"."approvals"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
96
|
+
ALTER TABLE "budget_policies" ADD CONSTRAINT "budget_policies_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
97
|
+
CREATE INDEX "budget_incidents_company_status_idx" ON "budget_incidents" USING btree ("company_id","status");--> statement-breakpoint
|
|
98
|
+
CREATE INDEX "budget_incidents_company_scope_idx" ON "budget_incidents" USING btree ("company_id","scope_type","scope_id","status");--> statement-breakpoint
|
|
99
|
+
CREATE UNIQUE INDEX "budget_incidents_policy_window_threshold_idx" ON "budget_incidents" USING btree ("policy_id","window_start","threshold_type");--> statement-breakpoint
|
|
100
|
+
CREATE INDEX "budget_policies_company_scope_active_idx" ON "budget_policies" USING btree ("company_id","scope_type","scope_id","is_active");--> statement-breakpoint
|
|
101
|
+
CREATE INDEX "budget_policies_company_window_idx" ON "budget_policies" USING btree ("company_id","window_kind","metric");--> statement-breakpoint
|
|
102
|
+
CREATE UNIQUE INDEX "budget_policies_company_scope_metric_unique_idx" ON "budget_policies" USING btree ("company_id","scope_type","scope_id","metric","window_kind");
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
DROP INDEX "budget_incidents_policy_window_threshold_idx";--> statement-breakpoint
|
|
2
|
+
CREATE UNIQUE INDEX "budget_incidents_policy_window_threshold_idx" ON "budget_incidents" USING btree ("policy_id","window_start","threshold_type") WHERE "budget_incidents"."status" <> 'dismissed';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
CREATE TABLE "execution_workspaces" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"company_id" uuid NOT NULL,
|
|
4
|
+
"project_id" uuid NOT NULL,
|
|
5
|
+
"project_workspace_id" uuid,
|
|
6
|
+
"source_issue_id" uuid,
|
|
7
|
+
"mode" text NOT NULL,
|
|
8
|
+
"strategy_type" text NOT NULL,
|
|
9
|
+
"name" text NOT NULL,
|
|
10
|
+
"status" text DEFAULT 'active' NOT NULL,
|
|
11
|
+
"cwd" text,
|
|
12
|
+
"repo_url" text,
|
|
13
|
+
"base_ref" text,
|
|
14
|
+
"branch_name" text,
|
|
15
|
+
"provider_type" text DEFAULT 'local_fs' NOT NULL,
|
|
16
|
+
"provider_ref" text,
|
|
17
|
+
"derived_from_execution_workspace_id" uuid,
|
|
18
|
+
"last_used_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
19
|
+
"opened_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
20
|
+
"closed_at" timestamp with time zone,
|
|
21
|
+
"cleanup_eligible_at" timestamp with time zone,
|
|
22
|
+
"cleanup_reason" text,
|
|
23
|
+
"metadata" jsonb,
|
|
24
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
25
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
26
|
+
);
|
|
27
|
+
--> statement-breakpoint
|
|
28
|
+
CREATE TABLE "issue_work_products" (
|
|
29
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
30
|
+
"company_id" uuid NOT NULL,
|
|
31
|
+
"project_id" uuid,
|
|
32
|
+
"issue_id" uuid NOT NULL,
|
|
33
|
+
"execution_workspace_id" uuid,
|
|
34
|
+
"runtime_service_id" uuid,
|
|
35
|
+
"type" text NOT NULL,
|
|
36
|
+
"provider" text NOT NULL,
|
|
37
|
+
"external_id" text,
|
|
38
|
+
"title" text NOT NULL,
|
|
39
|
+
"url" text,
|
|
40
|
+
"status" text NOT NULL,
|
|
41
|
+
"review_state" text DEFAULT 'none' NOT NULL,
|
|
42
|
+
"is_primary" boolean DEFAULT false NOT NULL,
|
|
43
|
+
"health_status" text DEFAULT 'unknown' NOT NULL,
|
|
44
|
+
"summary" text,
|
|
45
|
+
"metadata" jsonb,
|
|
46
|
+
"created_by_run_id" uuid,
|
|
47
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
48
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
49
|
+
);
|
|
50
|
+
--> statement-breakpoint
|
|
51
|
+
ALTER TABLE "issues" ADD COLUMN "project_workspace_id" uuid;--> statement-breakpoint
|
|
52
|
+
ALTER TABLE "issues" ADD COLUMN "execution_workspace_id" uuid;--> statement-breakpoint
|
|
53
|
+
ALTER TABLE "issues" ADD COLUMN "execution_workspace_preference" text;--> statement-breakpoint
|
|
54
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "source_type" text DEFAULT 'local_path' NOT NULL;--> statement-breakpoint
|
|
55
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "default_ref" text;--> statement-breakpoint
|
|
56
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "visibility" text DEFAULT 'default' NOT NULL;--> statement-breakpoint
|
|
57
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "setup_command" text;--> statement-breakpoint
|
|
58
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "cleanup_command" text;--> statement-breakpoint
|
|
59
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "remote_provider" text;--> statement-breakpoint
|
|
60
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "remote_workspace_ref" text;--> statement-breakpoint
|
|
61
|
+
ALTER TABLE "project_workspaces" ADD COLUMN "shared_workspace_key" text;--> statement-breakpoint
|
|
62
|
+
ALTER TABLE "workspace_runtime_services" ADD COLUMN "execution_workspace_id" uuid;--> statement-breakpoint
|
|
63
|
+
ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
64
|
+
ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
65
|
+
ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_project_workspace_id_project_workspaces_id_fk" FOREIGN KEY ("project_workspace_id") REFERENCES "public"."project_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
66
|
+
ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_source_issue_id_issues_id_fk" FOREIGN KEY ("source_issue_id") REFERENCES "public"."issues"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
67
|
+
ALTER TABLE "execution_workspaces" ADD CONSTRAINT "execution_workspaces_derived_from_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("derived_from_execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
68
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
69
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
70
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_issue_id_issues_id_fk" FOREIGN KEY ("issue_id") REFERENCES "public"."issues"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
71
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
72
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_runtime_service_id_workspace_runtime_services_id_fk" FOREIGN KEY ("runtime_service_id") REFERENCES "public"."workspace_runtime_services"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
73
|
+
ALTER TABLE "issue_work_products" ADD CONSTRAINT "issue_work_products_created_by_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("created_by_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
74
|
+
CREATE INDEX "execution_workspaces_company_project_status_idx" ON "execution_workspaces" USING btree ("company_id","project_id","status");--> statement-breakpoint
|
|
75
|
+
CREATE INDEX "execution_workspaces_company_project_workspace_status_idx" ON "execution_workspaces" USING btree ("company_id","project_workspace_id","status");--> statement-breakpoint
|
|
76
|
+
CREATE INDEX "execution_workspaces_company_source_issue_idx" ON "execution_workspaces" USING btree ("company_id","source_issue_id");--> statement-breakpoint
|
|
77
|
+
CREATE INDEX "execution_workspaces_company_last_used_idx" ON "execution_workspaces" USING btree ("company_id","last_used_at");--> statement-breakpoint
|
|
78
|
+
CREATE INDEX "execution_workspaces_company_branch_idx" ON "execution_workspaces" USING btree ("company_id","branch_name");--> statement-breakpoint
|
|
79
|
+
CREATE INDEX "issue_work_products_company_issue_type_idx" ON "issue_work_products" USING btree ("company_id","issue_id","type");--> statement-breakpoint
|
|
80
|
+
CREATE INDEX "issue_work_products_company_execution_workspace_type_idx" ON "issue_work_products" USING btree ("company_id","execution_workspace_id","type");--> statement-breakpoint
|
|
81
|
+
CREATE INDEX "issue_work_products_company_provider_external_id_idx" ON "issue_work_products" USING btree ("company_id","provider","external_id");--> statement-breakpoint
|
|
82
|
+
CREATE INDEX "issue_work_products_company_updated_idx" ON "issue_work_products" USING btree ("company_id","updated_at");--> statement-breakpoint
|
|
83
|
+
ALTER TABLE "issues" ADD CONSTRAINT "issues_project_workspace_id_project_workspaces_id_fk" FOREIGN KEY ("project_workspace_id") REFERENCES "public"."project_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
84
|
+
ALTER TABLE "issues" ADD CONSTRAINT "issues_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
85
|
+
ALTER TABLE "workspace_runtime_services" ADD CONSTRAINT "workspace_runtime_services_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
86
|
+
CREATE INDEX "issues_company_project_workspace_idx" ON "issues" USING btree ("company_id","project_workspace_id");--> statement-breakpoint
|
|
87
|
+
CREATE INDEX "issues_company_execution_workspace_idx" ON "issues" USING btree ("company_id","execution_workspace_id");--> statement-breakpoint
|
|
88
|
+
CREATE INDEX "project_workspaces_project_source_type_idx" ON "project_workspaces" USING btree ("project_id","source_type");--> statement-breakpoint
|
|
89
|
+
CREATE INDEX "project_workspaces_company_shared_key_idx" ON "project_workspaces" USING btree ("company_id","shared_workspace_key");--> statement-breakpoint
|
|
90
|
+
CREATE UNIQUE INDEX "project_workspaces_project_remote_ref_idx" ON "project_workspaces" USING btree ("project_id","remote_provider","remote_workspace_ref");--> statement-breakpoint
|
|
91
|
+
CREATE INDEX "workspace_runtime_services_company_execution_workspace_status_idx" ON "workspace_runtime_services" USING btree ("company_id","execution_workspace_id","status");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TABLE "instance_settings" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"singleton_key" text DEFAULT 'default' NOT NULL,
|
|
4
|
+
"experimental" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
5
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
6
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
CREATE UNIQUE INDEX "instance_settings_singleton_key_idx" ON "instance_settings" USING btree ("singleton_key");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
CREATE TABLE "workspace_operations" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"company_id" uuid NOT NULL,
|
|
4
|
+
"execution_workspace_id" uuid,
|
|
5
|
+
"heartbeat_run_id" uuid,
|
|
6
|
+
"phase" text NOT NULL,
|
|
7
|
+
"command" text,
|
|
8
|
+
"cwd" text,
|
|
9
|
+
"status" text DEFAULT 'running' NOT NULL,
|
|
10
|
+
"exit_code" integer,
|
|
11
|
+
"log_store" text,
|
|
12
|
+
"log_ref" text,
|
|
13
|
+
"log_bytes" bigint,
|
|
14
|
+
"log_sha256" text,
|
|
15
|
+
"log_compressed" boolean DEFAULT false NOT NULL,
|
|
16
|
+
"stdout_excerpt" text,
|
|
17
|
+
"stderr_excerpt" text,
|
|
18
|
+
"metadata" jsonb,
|
|
19
|
+
"started_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
20
|
+
"finished_at" timestamp with time zone,
|
|
21
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
22
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
23
|
+
);
|
|
24
|
+
--> statement-breakpoint
|
|
25
|
+
ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
26
|
+
ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_execution_workspace_id_execution_workspaces_id_fk" FOREIGN KEY ("execution_workspace_id") REFERENCES "public"."execution_workspaces"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
27
|
+
ALTER TABLE "workspace_operations" ADD CONSTRAINT "workspace_operations_heartbeat_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("heartbeat_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
28
|
+
CREATE INDEX "workspace_operations_company_run_started_idx" ON "workspace_operations" USING btree ("company_id","heartbeat_run_id","started_at");--> statement-breakpoint
|
|
29
|
+
CREATE INDEX "workspace_operations_company_workspace_started_idx" ON "workspace_operations" USING btree ("company_id","execution_workspace_id","started_at");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE "heartbeat_runs" ADD COLUMN "process_pid" integer;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "heartbeat_runs" ADD COLUMN "process_started_at" timestamp with time zone;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "heartbeat_runs" ADD COLUMN "retry_of_run_id" uuid;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "heartbeat_runs" ADD COLUMN "process_loss_retry_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "heartbeat_runs" ADD CONSTRAINT "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("retry_of_run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;
|