
SQL error during quick install script
Reported by ashskutches | November 17th, 2010 @ 11:32 AM | in 1.0 Release
Hi there,
We're setting up a new webiva installation, and I get the following error when it runs the migrations to create the first client account:
-- create_table("page_paragraphs", {:force=>true})
SQL (0.6ms) SHOW TABLES
SQL (0.0ms) Mysql::Error: BLOB/TEXT column 'display_body' can't have a default value: CREATE TABLE `page_paragraphs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `page_revision_id` int(11) DEFAULT 0 NOT NULL, `zone_idx` int(11) DEFAULT 0 NOT NULL, `position` int(11) DEFAULT 0 NOT NULL, `display_type` varchar(255) DEFAULT 'text', `display_body` text DEFAULT '' NOT NULL, `name` varchar(255), `display_module` varchar(255), `site_module_id` int(11), `data` text, `site_feature_id` int(11)) ENGINE=InnoDB
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: BLOB/TEXT column 'display_body' can't have a default value: CREATE TABLE `page_paragraphs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `page_revision_id` int(11) DEFAULT 0 NOT NULL, `zone_idx` int(11) DEFAULT 0 NOT NULL, `position` int(11) DEFAULT 0 NOT NULL, `display_type` varchar(255) DEFAULT 'text', `display_body` text DEFAULT '' NOT NULL, `name` varchar(255), `display_module` varchar(255), `site_module_id` int(11), `data` text, `site_feature_id` int(11)) ENGINE=InnoDB
(See full trace by running task with --trace)
Error creating initial domain database, please run 'rake --trace cms:create_domain_db DOMAIN_ID=1' manually to see errors
This happens during the InitialDb (1) migration. The problem is fixed if you modify the migration and either remove the default for the text field, or change its type to string.
And if we fix that migration by removing the default value, migration 81 blows up later with the same problem:
Migrating to AddSiteTemplateHead (81)
== AddSiteTemplateHead: migrating ============================================
-- add_column(:site_templates, :head, :text, {:default=>""})
SQL (0.0ms) Mysql::Error: BLOB/TEXT column 'head' can't have a default value: ALTER TABLE `site_templates` ADD `head` text DEFAULT ''
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: BLOB/TEXT column 'head' can't have a default value: ALTER TABLE `site_templates` ADD `head` text DEFAULT ''
(See full trace by running task with --trace)
Error creating initial domain database, please run 'rake --trace cms:create_domain_db DOMAIN_ID=1' manually to see errors
System information:
Mac OS X snow leopard
mysql Ver 14.14 Distrib 5.1.49, for apple-darwin10.4.0 (i386) using readline 6.1
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02
Webiva Version 0.99.1
Comments and changes to this ticket
-
Scott Woods November 17th, 2010 @ 08:43 PM
- Tag set to bug, migrations, mysql
This was our fix: https://github.com/westarete/Webiva/commit/312e3bbdd1a216286e9a47b8...
-
Pascal Rettig November 19th, 2010 @ 10:04 AM
- State changed from new to open
- Assigned user set to Pascal Rettig
Thanks for submitting this - I can't duplicate on 5.1.47, but the mysql docs do indicate that text fields can't have defaults (usually it only shows up as a warning) - I'll see if I can duplicate on an upgrade mysql.
-
Pascal Rettig November 19th, 2010 @ 10:05 AM
- Milestone set to 1.0 Release
- Milestone order changed from 192404 to 0
-
Pascal Rettig November 23rd, 2010 @ 12:37 PM
- Assigned user changed from Pascal Rettig to Doug
-
Doug November 23rd, 2010 @ 04:28 PM
- State changed from open to resolved
- Milestone order changed from 9 to 0
Basically just used what Scott had and add self.head ||= '' to the before_create in site template.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป