Skip to content

refactor!: consolidate migrations from 9 chronological files into 4 object-oriented files#76

Merged
deepjoy merged 1 commit into
mainfrom
reorg-migrations
Mar 22, 2026
Merged

refactor!: consolidate migrations from 9 chronological files into 4 object-oriented files#76
deepjoy merged 1 commit into
mainfrom
reorg-migrations

Conversation

@deepjoy

@deepjoy deepjoy commented Mar 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reorganize 9 chronological migration files into 4 files grouped by database object: tasks, task_history, task_deps, and task_tags/task_history_tags
  • Fold all ALTER TABLE ADD COLUMN statements (label, net IO, groups, TTL, scheduling, dependencies, retries, memo) into their respective CREATE TABLE definitions, eliminating every ALTER statement
  • Simplify migrate() in store/mod.rs — all migrations now use idempotent CREATE TABLE/INDEX IF NOT EXISTS, removing the run_alter_migration helper

New migration layout

File Object(s) Indexes
001_tasks.sql tasks (32 cols) 6 partial indexes
002_task_history.sql task_history (30 cols) 5 indexes
003_task_deps.sql task_deps 1 index
004_task_tags.sql task_tags, task_history_tags 2 indexes

BREAKING CHANGE: Existing SQLite databases must be recreated. This is acceptable as the project is pre-1.0.

…ted files

Collapse all ALTER TABLE additions (label, net IO, groups, TTL,
scheduling, dependencies, retries, memo) into the CREATE TABLE
definitions, eliminating every ALTER statement.

New layout:
  001_tasks.sql         – tasks table + 6 indexes
  002_task_history.sql  – task_history table + 5 indexes
  003_task_deps.sql     – task_deps table + 1 index
  004_task_tags.sql     – task_tags & task_history_tags + 2 indexes

BREAKING CHANGE: existing databases must be recreated (pre-1.0).
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Comparison

Click to expand
group                                       current
-----                                       -------
backoff_delay/constant                      1.00     50.2±0.19ns        ? ?/sec
backoff_delay/exponential                   1.00    186.9±0.41ns        ? ?/sec
backoff_delay/exponential_jitter            1.00    269.0±0.67ns        ? ?/sec
backoff_delay/linear                        1.00     76.3±0.49ns        ? ?/sec
batch_submit_1000                           1.00     34.3±2.97ms        ? ?/sec
byte_progress/byte_reporting_500            1.00    248.1±5.04ms        ? ?/sec
byte_progress/noop_500                      1.00    245.9±5.00ms        ? ?/sec
byte_progress_snapshot_100_tasks            1.00     82.3±2.43ms        ? ?/sec
concurrency_scaling/1                       1.00    382.4±4.95ms        ? ?/sec
concurrency_scaling/2                       1.00    317.6±6.60ms        ? ?/sec
concurrency_scaling/4                       1.00    273.1±5.82ms        ? ?/sec
concurrency_scaling/8                       1.00    247.7±4.16ms        ? ?/sec
count_by_tags/100                           1.00    131.7±4.30µs        ? ?/sec
count_by_tags/1000                          1.00    220.7±3.10µs        ? ?/sec
count_by_tags/5000                          1.00    610.1±6.86µs        ? ?/sec
dep_chain_dispatch/10                       1.00     11.1±0.17ms        ? ?/sec
dep_chain_dispatch/25                       1.00     27.2±0.44ms        ? ?/sec
dep_chain_dispatch/50                       1.00     54.1±1.04ms        ? ?/sec
dep_chain_submit/10                         1.00      3.1±0.10ms        ? ?/sec
dep_chain_submit/200                        1.00     79.3±4.12ms        ? ?/sec
dep_chain_submit/50                         1.00     17.3±1.03ms        ? ?/sec
dep_fan_in_dispatch/10                      1.00      7.1±0.10ms        ? ?/sec
dep_fan_in_dispatch/100                     1.00     53.1±1.23ms        ? ?/sec
dep_fan_in_dispatch/50                      1.00     27.6±0.44ms        ? ?/sec
dispatch_and_complete_1000                  1.00    496.8±8.56ms        ? ?/sec
dispatch_group_scaling/1                    1.00    422.1±7.94ms        ? ?/sec
dispatch_group_scaling/10                   1.00    425.8±4.94ms        ? ?/sec
dispatch_group_scaling/100                  1.00    426.1±5.19ms        ? ?/sec
dispatch_group_scaling/50                   1.00    425.6±4.99ms        ? ?/sec
dispatch_no_groups_500                      1.00    248.6±4.34ms        ? ?/sec
dispatch_one_group_500                      1.00    421.2±7.47ms        ? ?/sec
dispatch_permanent_failure_500              1.00    365.6±5.52ms        ? ?/sec
history_by_type/100                         1.00   890.1±14.46µs        ? ?/sec
history_by_type/1000                        1.00   912.2±23.22µs        ? ?/sec
history_by_type/5000                        1.00   932.3±22.07µs        ? ?/sec
history_query/100                           1.00   541.9±10.50µs        ? ?/sec
history_query/1000                          1.00    543.2±6.59µs        ? ?/sec
history_query/5000                          1.00    553.8±9.24µs        ? ?/sec
history_stats/100                           1.00    149.9±0.58µs        ? ?/sec
history_stats/1000                          1.00    379.5±1.17µs        ? ?/sec
history_stats/5000                          1.00   1368.9±2.68µs        ? ?/sec
mixed_priority_dispatch_500                 1.00    271.8±5.59ms        ? ?/sec
peek_next/100                               1.00    125.2±3.11µs        ? ?/sec
peek_next/1000                              1.00    122.8±3.21µs        ? ?/sec
peek_next/5000                              1.00    125.1±3.77µs        ? ?/sec
query_by_tags/100                           1.00  1230.9±145.40µs        ? ?/sec
query_by_tags/1000                          1.00      9.8±0.78ms        ? ?/sec
query_by_tags/5000                          1.00     55.7±2.04ms        ? ?/sec
retryable_dead_letter/constant              1.00    147.6±1.80ms        ? ?/sec
retryable_dead_letter/exponential           1.00    148.3±2.03ms        ? ?/sec
retryable_dead_letter/exponential_jitter    1.00    149.2±2.07ms        ? ?/sec
retryable_dead_letter/linear                1.00    148.5±2.15ms        ? ?/sec
submit_1000_tasks                           1.00    184.9±6.38ms        ? ?/sec
submit_dedup_hit_1000                       1.00    244.8±9.34ms        ? ?/sec
submit_with_tags/0                          1.00     92.5±3.72ms        ? ?/sec
submit_with_tags/10                         1.00   245.5±12.57ms        ? ?/sec
submit_with_tags/20                         1.00   405.8±19.33ms        ? ?/sec
submit_with_tags/5                          1.00    171.2±7.28ms        ? ?/sec
tag_values/100                              1.00    135.6±3.13µs        ? ?/sec
tag_values/1000                             1.00    198.6±6.13µs        ? ?/sec
tag_values/5000                             1.00    468.1±4.99µs        ? ?/sec

@deepjoy deepjoy merged commit a36f033 into main Mar 22, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant