Bug #19189

db:migrate breaks RPM build

Added by Eric Helms 8 months ago. Updated 8 months ago.

Status:Closed
Priority:Urgent
Assigned To:Justin Sherrill
Category:Database
Target version:Team Brad - Iteration 13
Difficulty: Pull request:https://github.com/Katello/katello/pull/6735, https://github.com/Katello/katello/pull/6738, https://github.com/Katello/katello/pull/6739, https://github.com/Katello/katello/pull/6740
Bugzilla link:
Story points-
Velocity based estimate-
ReleaseKatello 3.4.0Release relationshipAuto

Description

The recent merge of a future dated subscriptions migration is incompatible with sqlite and thus broke RPM building:

== 20170222131211 ChangePoolColumnsToDates: migrating =========================
-- change_column(:katello_pools, :start_date, "timestamp USING CAST(start_date AS timestamp without time zone)")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: near "USING": syntax error: CREATE TABLE "katello_pools" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "cp_id" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "subscription_id" integer, "account_number" integer, "contract_number" integer, "virtual" boolean, "quantity" integer, "start_date" timestamp USING CAST(start_date AS timestamp without time zone), "pool_type" varchar(255), "end_date" varchar(255), "ram" integer, "multi_entitlement" boolean, "consumed" integer, "virt_only" boolean DEFAULT 'f' NOT NULL, "unmapped_guest" boolean DEFAULT 'f' NOT NULL, "virt_who" boolean DEFAULT 'f' NOT NULL) /opt/rh/sclo-ror42/root/usr/share/gems/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:134:in `execute'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-

Related issues

Blocks Katello - Feature #18631: As a user, I want future-dated subscriptions to be displa... Closed 02/22/2017

Associated revisions

Revision 493c5c9f
Added by Justin Sherrill 8 months ago

fixes #19189 - only migrate if postgresql

Revision 35de7e89
Added by Eric Helms 8 months ago

Refs #19189 - Check if adapter includes sqlite

Turns out the adapter is SQlite which downcases to sqlite and does
not match the name of the adapter that one would specify in
the database.yml. This switches to check for include to match sqlite
in case Rails for some reason changes this name.

History

#1 Updated by Eric Helms 8 months ago

  • Blocks Feature #18631: As a user, I want future-dated subscriptions to be displayed. added

#2 Updated by The Foreman Bot 8 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Thomas McKay
  • Pull request https://github.com/Katello/katello/pull/6735 added

#3 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/Katello/katello/pull/6738 added

#4 Updated by Justin Sherrill 8 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Justin Sherrill 8 months ago

  • Assigned To changed from Thomas McKay to Justin Sherrill
  • Target version set to Team Brad - Iteration 13

#6 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/Katello/katello/pull/6739 added

#7 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/Katello/katello/pull/6740 added

Also available in: Atom PDF