Doing this i can successfully connect to database and signup and login into the Spacedeck-open.
Problem i was facing:
But in the artifact sequelize model i found follwing
Artifact: sequelize.define('artifact', {
// removed other fields for simplicity
shape_svg: Sequelize.STRING, // <-- which generates VARCHAR(255)
}),
this shape_svg property type generated into VARCHAR(255) in Mysql. It generates svg xml which can be greater than 255 character.
Solution:
Changing the datatype to following solved my issue.
Artifact: sequelize.define('artifact', {
// removed other fields for simplicity
shape_svg: Sequelize.TEXT,
}),
Further investigation:
I was wondering what data type SQLite was generating for Sequelize.STRING. It was generating VARCHAR(255) for shape_svg. Even the following svg xml was stored inside the shape_svg column.
(9) What is the maximum size of a VARCHAR in SQLite?
SQLite does not enforce the length of a VARCHAR. You can declare a VARCHAR(10) and SQLite will be happy to store a 500-million character string there. And it will keep all 500-million characters intact. Your content is never truncated. SQLite understands the column type of "VARCHAR(N)" to be the same as "TEXT", regardless of the value of N.
That is why spacedeck-open running on SQLite facing no such issue.
I will be pleased to put a pull request resolving this issue.
What i was doing ?
Recently i was working on porting spacedeck-open from sqlite to Mysql.
I changed the
models > db.js
Doing this i can successfully connect to database and signup and login into the Spacedeck-open.
Problem i was facing:
But in the
artifact
sequelize model i found follwingthis
shape_svg
property type generated intoVARCHAR(255)
in Mysql. It generates svg xml which can be greater than 255 character.Solution:
Changing the datatype to following solved my issue.
Further investigation:
I was wondering what data type SQLite was generating for
Sequelize.STRING
. It was generatingVARCHAR(255)
forshape_svg
. Even the following svg xml was stored inside theshape_svg
column.It's length was 519. How it is possible that
VARCHAR(255)
storing a 519 length string ?From SQLite FAQ i came to know that
That is why spacedeck-open running on SQLite facing no such issue.
I will be pleased to put a pull request resolving this issue.