#328 ✓resolved
Chris Barnett

Migration failing on PostgreSQL

Reported by Chris Barnett | August 31st, 2009 @ 01:34 PM

engines/adva_cms/db/migrate/20090709111934_add_email_notification_to_site.rb has:

add_column :sites, :email_notification, :boolean, :default => 0

Which fails under PostgreSQL:

==  AddEmailNotificationToSite: migrating =====================================
-- add_column(:sites, :email_notification, :boolean, {:default=>0})
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR:  column "email_notification" is of type boolean but default expression is of type integer
HINT:  You will need to rewrite or cast the expression.
: ALTER TABLE "sites" ALTER COLUMN "email_notification" SET DEFAULT 0

The attached patch replaces :default => 0 with :default => false

Comments and changes to this ticket

  • Marko Seppä

    Marko Seppä November 23rd, 2009 @ 05:25 PM

    • State changed from “new” to “resolved”

    Hi Chris,

    sorry for late answer. Seems like this one has already applied to adva-cms master.

    Thanks for the contribution,

    -- Marko

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>

<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>

<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>

Attachments

Pages