---
title: "Deprecating `insertion_date`"
excerpt: "We're deprecating the automatically generated `insertion_date` column. Here's why."
date: "2024-06-17"
---

# `insertion_date` deprecation

We're deprecating the automatically generated `insertion_date` column. Here's why:

When creating a new Data Source in Tinybird, the Sorting Key is a required setting. Users can specify it with the optional [ENGINE_SORTING_KEY](/classic/cli/datafiles/datasource-files) setting. If it's not specified, Tinybird chooses a safe default from the defined columns. Only non-nullable columns can be used for the Sorting Key, so if all columns in the schema are nullable, Tinybird created a new non-nullable column called `insertion_date` and used that as the Sorting Key.

This automatically created column, which isn't defined by the user, was causing issues when iterating a Data Source. It's not explicitly listed in the .datasource file but still exists, creating an inconsistency. To address this, we've deprecated this behavior. Now, [ENGINE_SORTING_KEY](/classic/cli/datafiles/datasource-files) will default to `tuple()` if there are no suitable columns in the schema definition.

This new behavior ensures that the `.datasources` files in your data project are 100% consistent with your Workspace resources.

## How to prepare for the deprecation

Update your [Tinybird CLI to > 5.0.0](https://pypi.org/project/tinybird-cli/) and run `tb pull --force`. This will make `insertion_date` explicit in your datafiles.

If you use [Branches](/classic/work-with-data/organize-your-work/branches) and [version control](/classic/work-with-data/organize-your-work/working-with-version-control), we have added [an example in our Use Case repository](https://github.com/tinybirdco/use-case-examples/tree/main/add_column_BQ_ds) that demonstrates how to integrate these changes.

You can use a CLI version prior to `5.0.0` if you need to continue using the `insertion_date` column implicitly.
