{"record":{"id":"810e84a3fe3e5db9","repo":"clockworklabs/SpacetimeDB","slug":"scheduled-tables-must-have-a-scheduled-at-spacet","errorCode":null,"errorMessage":"scheduled tables must have a `scheduled_at: spacetimedb::ScheduleAt` column. if the column has a name besides `scheduled_at`, you can specify it with `scheduled(my_reducer, at = custom_scheduled_at)`","messagePattern":"scheduled tables must have a `scheduled_at: spacetimedb::ScheduleAt` column\\. if the column has a name besides `scheduled_at`, you can specify it with `scheduled\\(my_reducer, at = custom_scheduled_at\\)`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bindings-macro/src/table.rs","lineNumber":1096,"sourceCode":"        .as_ref()\n        .map(|sched| {\n            let scheduled_at_column = match &sched.at {\n                Some(at) => Some(find_column(&columns, at)?),\n                None => try_find_column(&columns, \"scheduled_at\"),\n            };\n            // better error message when both are missing\n            if scheduled_at_column.is_none() && primary_key_column.is_none() {\n                return Err(syn::Error::new(\n                    sched.span,\n                    \"scheduled table missing required columns; add these to your struct:\\n\\\n                             #[primary_key]\\n\\\n                             #[auto_inc]\\n\\\n                             scheduled_id: u64,\\n\\\n                             scheduled_at: spacetimedb::ScheduleAt,\",\n                ));\n            }\n            let scheduled_at_column = scheduled_at_column.ok_or_else(|| {\n                syn::Error::new(\n                    sched.span,\n                    \"scheduled tables must have a `scheduled_at: spacetimedb::ScheduleAt` column. \\\n                             if the column has a name besides `scheduled_at`, you can specify it with \\\n                             `scheduled(my_reducer, at = custom_scheduled_at)`\",\n                )\n            })?;\n            let primary_key_column = primary_key_column.ok_or_else(|| {\n                syn::Error::new(\n                    sched.span,\n                    \"scheduled tables must have a `#[primary_key] #[auto_inc] scheduled_id: u64` column\",\n                )\n            })?;\n\n            let reducer_or_procedure = &sched.reducer_or_procedure;\n            let scheduled_at_id = scheduled_at_column.index;\n            let desc = quote!(spacetimedb::table::ScheduleDesc {\n                reducer_or_procedure_name: <#reducer_or_procedure as spacetimedb::rt::FnInfo>::NAME,\n                scheduled_at_column: #scheduled_at_id,","sourceCodeStart":1078,"sourceCodeEnd":1114,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings-macro/src/table.rs#L1078-L1114","documentation":"Scheduled-table validation found a primary-key column but no time column: there is no field named `scheduled_at` and no `at = custom` option resolving to one. The error, emitted at the `scheduled` argument's span, suggests either adding the standard column or pointing `at = ...` at a custom-named `ScheduleAt` column.","triggerScenarios":"A scheduled table where a primary-key column exists but no `scheduled_at` field exists and no `at = ...` reference resolves to a field.","commonSituations":"Renaming `scheduled_at` (for example to `fire_at`) without adding `at = fire_at`; removing the time column while refactoring the scheduler schema.","solutions":["Add a `scheduled_at: spacetimedb::ScheduleAt` column","Or, for a custom column name, declare it with `scheduled(reducer, at = your_column)`","If the column was removed by mistake, restore it"],"exampleFix":"// before\n#[spacetimedb::table(accessor = jobs, scheduled(run_jobs))]\nstruct Jobs {\n    #[primary_key]\n    #[auto_inc]\n    scheduled_id: u64,\n    fire_at: spacetimedb::ScheduleAt,\n}\n\n// after\n#[spacetimedb::table(accessor = jobs, scheduled(run_jobs, at = fire_at))]\nstruct Jobs {\n    #[primary_key]\n    #[auto_inc]\n    scheduled_id: u64,\n    fire_at: spacetimedb::ScheduleAt,\n}","handlingStrategy":"validation","validationCode":"# scheduled tables missing the time column\ngrep -rl 'scheduled(' src/ | xargs -r grep -L 'scheduled_at' || echo OK","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the conventional column name `scheduled_at` unless you pass `at = ...`","Rename the time column and its `at = ...` reference together","Run cargo check after any scheduled-table schema change"],"tags":["rust","proc-macro","spacetimedb","scheduled-table","compile-time"],"backgroundTag":"missing-required-schema-fields","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}