Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql2::Error: Data too long for column 'body' at row 1: INSERT INTO `spree_themes_templates #26

Open
NAHNAH55 opened this issue May 27, 2018 · 1 comment
Assignees

Comments

@NAHNAH55
Copy link

When using mysql, importing the theme "Unite" fails with a database error.

ActiveRecord::ValueTooLong in Spree::Admin::ThemesController#upload

Mysql2::Error: Data too long for column 'body' at row 1: INSERT INTO spree_themes_templates (name, body, path, locale, theme_id, created_at, updated_at) VALUES ('slick.js', '/*\n _ _ _ \n | () | | __ ()\n/ | | |/ | |/ / | / |\n\ \ | | (| < _ | \ \\n|/||\||\()/ |/\n |/\n\n Version: 1.8.0\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n\n /\n/ global window, document, define, jQuery, setInterval, clearInterval */\n;(function(factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (typeof exports !== 'undefined') {\n module.exports = factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n\n}(function($) {\n 'use strict';\n var Slick = window.Slick || {};\n\n Slick = (function() {\n\n var instanceUid = 0;\n\n function Slick(element, settings) {\n\n var _ = this, dataSettings;\n\n _.defaults = {\n accessibility: true,\n adaptiveHeight: false,\n appendArrows: $(element),\n appendDots: $(element),\n arrows: true,\n asNavFor: null,\n prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Prev..........................................................

And so on. The full dump is really long.

@himanshumishra31
Copy link
Contributor

Hi @NAHNAH55

This issue is db specific. It works fine on postgresql but mysql fails.
Kindly add a migration to your application

change_column :spree_themes_templates, :body, :longtext

It will work.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants