Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #2398

Closed
Open
Created Dec 27, 2012 by Administrator@rootOwner

DB Migration from 3.1 to 4.0 fails on PostgreSql

Created by: Philzen

Converted my SQLite installation to PostgreSql basically using this guide. This seems to have worked fine. Now i'm to upgrade from 3.1, which fails at DB Migration:

==  MoveNoteableCommitToOwnField: migrating ===================================
-- add_column(:notes, :commit_id, :string, {:null=>true})
   -> 0.0006s
-- add_column(:notes, :new_noteable_id, :integer, {:null=>true})
   -> 0.0003s
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR:  invalid input syntax for integer: ""
: UPDATE "notes" SET new_noteable_id = CAST (noteable_id AS INTEGER) WHERE (noteable_type != 'Commit')
/usr/home/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in `async_exec'
/usr/home/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in `exec_no_cache'
/usr/home/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:673:in `block in exec_delete'
/usr/home/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'

Looking at the migration-file db/migrate/20121218164840_move_noteable_commit_to_own_field.rb i cannot see a reason why this would fail other than rows with an empty notable_id being selected.

Does this mean that something is broken in my database or is this a valid scenario that simply hasn't been thought of in the SQL?

Assignee
Assign to
Time tracking