Actions
Bug #421
closedMigration AddEnabledToHosts fails with PostgreSQL
Description
The database migration AddEnabledToHosts
in db/migrate/20100823181036_add_enabled_to_hosts.rb
fails when being run with PostgreSQL as database. In contrast to SQLite and MySQL, PostgreSQL is rather serious about its type-system.
# rake db:migrate (in /srv/foreman) == CreateNotices: migrating ================================================== -- create_table(:notices) NOTICE: CREATE TABLE will create implicit sequence "notices_id_seq" for serial column "notices.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "notices_pkey" for table "notices" -> 0.4877s -- create_table(:user_notices, {:id=>false}) -> 0.0011s == CreateNotices: migrated (0.4891s) ========================================= == AddEnabledToHosts: migrating ============================================== -- add_column(:hosts, :enabled, :boolean, {:default=>1}) rake aborted! An error has occurred, this and all later migrations canceled: PGError: ERROR: column "enabled" is of type boolean but default expression is of type integer HINT: You will need to rewrite or cast the expression. : ALTER TABLE "hosts" ALTER COLUMN "enabled" SET DEFAULT 1 class AddEnabledToHosts < ActiveRecord::Migration (See full trace by running task with --trace)
Files
Updated by Jochen Schalanda about 14 years ago
- Status changed from New to Ready For Testing
- % Done changed from 0 to 100
Applied in changeset 83940766ad6212352905366531f2e3844f26c3d7.
Updated by Ohad Levy about 14 years ago
- Status changed from Ready For Testing to Closed
Actions