beads/internal/storage/schema/BUILD.bazel
Julian Knutsen 0773e6334e
docs(agents): contributor-only agent instructions and documented-issue intake (#7223)
Makes the repo's agent and contributor surface describe developing beads, not using bd, and requires every PR to link a documented issue.

- Contributor-only root AGENTS.md with a routing table; cmd/bd/AGENTS.md and engdocs/AGENTS.md seam files; CLAUDE.md symlinks so Claude Code loads nested files.
- Bug and feature issue forms, a PR template that requires Closes #, CONTRIBUTING sections for the triage and pipeline labels, and the opt-in fork-cache during dev setup.
- ROADMAP.md for 1.4: versioned beads (#6132), Graph Preview 2 (#7170), contributor onboarding (#7228).
- docsync guards: root AGENTS.md at or under 20 KB; every AGENTS.md symlinked, routed, and with resolving links, paths, and guard-test names.

Agent-Signature: claude-code-claude-opus-5-5-high on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 08:43:53 +00:00

199 lines
8.6 KiB
Python

load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "schema",
srcs = [
"aux_row_id_backfill.go",
"backfill.go",
"cli_migrations.go",
"cli_prepared_ddl.go",
"content_skew.go",
"converged.go",
"dep_id_backfill.go",
"dirty_tables_error.go",
"ignored_cursor_untrack.go",
"lock.go",
"migration_content_hashes.go",
"migration_repairs.go",
"remote_migrate_gate.go",
"schema.go",
"smart_remote_migrate_gate.go",
"wisp_dep_forward_repair.go",
],
embedsrcs = [
"migrations/0001_create_issues.up.sql",
"migrations/0002_create_dependencies.up.sql",
"migrations/0003_create_labels.up.sql",
"migrations/0004_create_comments.up.sql",
"migrations/0005_create_events.up.sql",
"migrations/0006_create_config.up.sql",
"migrations/0007_create_metadata.up.sql",
"migrations/0008_create_child_counters.up.sql",
"migrations/0009_create_issue_snapshots.up.sql",
"migrations/0010_create_compaction_snapshots.up.sql",
"migrations/0011_create_repo_mtimes.up.sql",
"migrations/0012_create_routes.up.sql",
"migrations/0013_create_issue_counter.up.sql",
"migrations/0014_create_interactions.up.sql",
"migrations/0015_create_federation_peers.up.sql",
"migrations/0016_default_config.up.sql",
"migrations/0017_create_ready_issues_view.up.sql",
"migrations/0018_create_blocked_issues_view.up.sql",
"migrations/0019_wisps_dolt_ignore.up.sql",
"migrations/0020_create_wisps.up.sql",
"migrations/0021_create_wisp_auxiliary.up.sql",
"migrations/0022_wisp_dep_type_index.up.sql",
"migrations/0023_add_no_history_column.up.sql",
"migrations/0024_create_custom_status_type_tables.up.sql",
"migrations/0025_update_ready_issues_view.up.sql",
"migrations/0026_update_blocked_issues_view.up.sql",
"migrations/0027_add_started_at.up.sql",
"migrations/0028_local_state_dolt_ignore.up.sql",
"migrations/0029_create_local_metadata.up.sql",
"migrations/0030_migrate_local_metadata_keys.up.sql",
"migrations/0031_wisp_events_created_at_index.up.sql",
"migrations/0032_drop_schema_migrations_applied_at.up.sql",
"migrations/0033_add_wisp_type_column.up.sql",
"migrations/0034_add_spec_id_column.up.sql",
"migrations/0035_migrate_infra_to_wisps.up.sql",
"migrations/0036_cleanup_autopush_metadata.up.sql",
"migrations/0037_uuid_primary_keys.up.sql",
"migrations/0038_drop_hop_columns.up.sql",
"migrations/0039_drop_child_counters_fk.up.sql",
"migrations/0040_ignored_tables_also_nonlocal_tables.up.sql",
"migrations/0041_split_dependencies_target.up.sql",
"migrations/0042_add_on_update_cascade.up.sql",
"migrations/0043_drop_dependencies_generated_column.up.sql",
"migrations/0044_update_views_drop_depends_on_id.up.sql",
"migrations/0045_update_blocked_view_drop_depends_on_id.up.sql",
"migrations/0046_add_is_blocked.up.sql",
"migrations/0047_recompute_mixed_is_blocked.up.sql",
"migrations/0048_widen_event_value_columns.up.sql",
"migrations/0049_longtext_large_content_columns.up.sql",
"migrations/0050_dependencies_deterministic_id.up.sql",
"migrations/0051_drop_aux_id_defaults.up.sql",
"migrations/0052_add_date_indexes.up.sql",
"migrations/0053_repair_rig_wisps.up.sql",
"migrations/0054_add_lease_columns.up.sql",
"migrations/0055_move_leases_to_table.up.sql",
"migrations/0056_add_comments_keyset_index.up.sql",
"migrations/0057_events_value_columns_idempotent_longtext.up.sql",
"migrations/0058_heal_wisp_dependencies_split_constraints.up.sql",
"migrations/0059_recompute_null_gate_is_blocked.up.sql",
"migrations/0060_add_storage_class.up.sql",
"migrations/0061_content_derived_aux_ids.up.sql",
"migrations/0062_events_dolt_ignore.up.sql",
"migrations/0063_create_provenance_events.up.sql",
"migrations/0064_create_events_journal.up.sql",
"migrations/0065_widen_wisp_comments_text.up.sql",
"migrations/0066_add_events_journal_actor.up.sql",
"migrations/0067_add_versioned_beads_schema.up.sql",
"migrations/0068_add_attribution_status.up.sql",
"migrations/ignored/0001_create_local_state_tables.up.sql",
"migrations/ignored/0002_create_wisp_child_counters.up.sql",
"migrations/ignored/0003_split_wisp_dependencies_target.up.sql",
"migrations/ignored/0004_add_wisp_aux_fks.up.sql",
"migrations/ignored/0005_drop_wisp_dependencies_generated_column.up.sql",
"migrations/ignored/0006_add_wisp_is_blocked.up.sql",
"migrations/ignored/0007_recompute_wisp_is_blocked.up.sql",
"migrations/ignored/0008_widen_wisp_event_value_columns.up.sql",
"migrations/ignored/0009_aux_row_id_rekey_marker.up.sql",
"migrations/ignored/0010_drop_wisp_id_defaults.up.sql",
"migrations/ignored/0011_cleanup_orphaned_child_counters.up.sql",
"migrations/ignored/0012_create_leases.up.sql",
"migrations/ignored/0013_add_wisp_row_lock.up.sql",
"migrations/ignored/0014_add_wisp_comments_keyset_index.up.sql",
"migrations/ignored/0015_recompute_null_gate_wisp_is_blocked.up.sql",
"migrations/ignored/0016_add_lease_granted_node.up.sql",
"migrations/ignored/0017_add_wisps_defer_until_index.up.sql",
"migrations/ignored/0018_aux_row_id_rekey2_marker.up.sql",
"migrations/ignored/0019_create_events.up.sql",
"migrations/ignored/0020_add_wisp_storage_class.up.sql",
"migrations/ignored/0021_widen_wisp_large_content_columns.up.sql",
"migrations/ignored/0022_create_events_journal.up.sql",
"migrations/ignored/0023_repair_events_journal_shape.up.sql",
"migrations/ignored/0024_widen_wisp_comments_text.up.sql",
"migrations/ignored/0025_add_events_journal_actor.up.sql",
"migrations/ignored/0026_dep_rekey_dedup_marker.up.sql",
"migrations/ignored/0027_add_wisps_current_revision.up.sql",
"migrations/0069_widen_issue_versions_datetime_precision.up.sql",
],
importpath = "github.com/steveyegge/beads/internal/storage/schema",
visibility = ["//:__subpackages__"],
deps = [
"//internal/debug",
"//internal/storage/dberrors",
"//internal/storage/depid",
"//internal/storage/issueops",
"//internal/storage/rowid",
"//internal/types",
"@org_golang_x_term//:term",
],
)
go_test(
name = "schema_test",
srcs = [
"aux_row_id_backfill_test.go",
"aux_row_id_drift_test.go",
"call_returning_row_test.go",
"cli_prepared_ddl_test.go",
"content_hash_test.go",
"content_skew_test.go",
"converged_test.go",
"cursor_reality_test.go",
"dep_id_backfill_test.go",
"dolt_ignore_seed_test.go",
"ignored_cursor_untrack_test.go",
"lock_test.go",
"migration_0067_versioned_beads_test.go",
"migration_0068_add_attribution_status_test.go",
"migration_0069_datetime_precision_test.go",
"migration_body_drain_test.go",
"migration_watchdog_test.go",
"progress_test.go",
"remote_migrate_gate_test.go",
"schema_skew_test.go",
"schema_test.go",
"shared_store_migrate_gate_test.go",
"smart_remote_migrate_gate_test.go",
],
data = [":migrations"],
embed = [":schema"],
deps = [
"//internal/debug",
"//internal/storage/depid",
"//internal/storage/rowid",
"//internal/testutil",
"@com_github_data_dog_go_sqlmock//:go-sqlmock",
"@com_github_go_sql_driver_mysql//:mysql",
"@org_golang_x_term//:term",
],
)
# Migration SQL (up, down, ignored/) and the nondeterminism allowlist, read
# from disk by schema and issueops tests beyond what the library embeds.
filegroup(
name = "migrations",
srcs = glob(["migrations/**"]),
visibility = ["//internal/storage:__subpackages__"],
)
# Linked from the root and engdocs AGENTS.md; //:docsync_files checks those links.
exports_files(
["migrations/README.md"],
visibility = ["//:__pkg__"],
)
# --- begin go_srcs (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
),
visibility = ["//:__subpackages__"],
)
# --- end go_srcs ---