Issue with Data Store in URL Shortener Workflow: Mysql2::Error Data too long for column 'code'

This topic was automatically generated from Slack. You can find the original thread here.

Hello,
Im having an issue with my Data store used in a workflow for an url shortener.

This is below the schema of the data stored:

#…
const short = {
‘id’: ulid(),
‘original_url’: url,
‘short_url_http’: ${base_url_http}/${code},
‘short_url_https’: ${base_url_https}/${code},
‘bitly_url’: bitlyShortUrl,
‘created_at’: new Date(),
‘updated_at’: new Date(),
‘deleted_at’: null,
};

        shorts.push(short);
        **await** **this**.myDataStore.**set**("shorts", shorts)”

#…
This is the error I get when I try to test and deploy my NodeJs script:

Code Error
Mysql2::Error: Data too long for column ‘code’ at row 1

The Data Store ID is ds_B5ugq8

Mind to help please ?

Feel free to ask me more questions

Hi, I think your question is a great case for Pipedream bot to help. I’ll pass your question to the Pipedream bot now. Please feel free to ask it any question

Hello,
Im having an issue with my Data store used in a workflow for an url shortener.

This is below the schema of the data stored:

#…
const short = {
‘id’: ulid(),
‘original_url’: url,
‘short_url_http’: ${base_url_http}/${code},
‘short_url_https’: ${base_url_https}/${code},
‘bitly_url’: bitlyShortUrl,
‘created_at’: new Date(),
‘updated_at’: new Date(),
‘deleted_at’: null,
};

        shorts.push(short);
        **await** **this**.myDataStore.**set**(“shorts”, shorts)”

#…
This is the error I get when I try to test and deploy my NodeJs script:

Code Error
Mysql2::Error: Data too long for column ‘code’ at row 1

The Data Store ID is ds_B5ugq8

Mind to help please ?

It looks like you’re encountering an error related to the code field being too long for the column in your MySQL database. To resolve this issue, you can either: 1. Increase the size of the code column in your MySQL table to accommodate longer values. 2. Ensure that the code value generated in your script is within the allowed length for the column in your MySQL table. If you need further assistance, please provide more details about how the code value is generated, and I’ll be happy to help.