You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explains how DataJoint 2.0 identifies blob columns via `:<blob>:` comment
markers. Without these markers, legacy blobs are treated as raw binary
and not deserialized.
Added:
- "Column Comment Format" section explaining the `:type:` format
- Usage examples for check_migration_status(), migrate_columns(),
and migrate_blob_columns() from datajoint.migrate
- Expanded "Option B: In-Place Migration" with step-by-step using
actual migration functions (backup_schema, migrate_columns,
rebuild_lineage, migrate_external, verify_schema_v20)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@@ -118,6 +118,88 @@ These codecs are NEW—there's no legacy equivalent to migrate:
118
118
119
119
**Learn more:**[Codec API Reference](../reference/specs/codec-api.md) · [Custom Codecs](../explanation/custom-codecs.md)
120
120
121
+
### Column Comment Format (Critical for Blob Migration)
122
+
123
+
DataJoint 2.0 stores type information in the SQL column comment using a `:type:` prefix format:
124
+
125
+
```sql
126
+
-- 2.0 column comment format
127
+
COMMENT ':<type>:user comment'
128
+
129
+
-- Examples
130
+
COMMENT ':int64:subject identifier'
131
+
COMMENT ':<blob>:serialized neural data'
132
+
COMMENT ':<blob@store>:large array in object storage'
133
+
```
134
+
135
+
**Why this matters for blob columns:**
136
+
137
+
In pre-2.0, `longblob` columns automatically deserialized Python objects using DataJoint's binary serialization format. DataJoint 2.0 identifies blob columns by checking for `:<blob>:` in the column comment. **Without this marker, blob columns are treated as raw binary data and will NOT be deserialized.**
138
+
139
+
| Column Comment | DataJoint 2.0 Behavior |
140
+
|----------------|----------------------|
141
+
|`:<blob>:neural data`| ✓ Deserializes to Python/NumPy objects |
142
+
|`neural data` (no marker) | ✗ Returns raw bytes (no deserialization) |
143
+
144
+
**Migration requirement:** Existing blob columns need their comments updated to include the `:<blob>:` prefix. This is a metadata-only change—the actual blob data format is unchanged.
145
+
146
+
#### Checking Migration Status
147
+
148
+
```python
149
+
from datajoint.migrate import check_migration_status
0 commit comments