我正在尝试将我的 sqlite3 数据库迁移到 Postgresql(我正在关注 Railscasts #342,但我在 ubuntu 上)。在rake db:create:all
我的aperitime_development
数据库上之后,我用 Taps 启动了一个 Sinatra 服务器(推送 mi sqlite3 db),但是当我尝试做
taps pull postgres://willy:piero@localhost/aperitime_development http://willy:ciao@localhost:5000'
数据未在 postgres db 上复制,并且控制台未正确终止:
Receiving schema
Schema: 0% | | ETA: --:--:--
Schema: 25% |========== | ETA: 00:00:07
Schema: 50% |===================== | ETA: 00:00:03
Schema: 75% |=============================== | ETA: 00:00:01
Schema: 100% |==========================================| Time: 00:00:04
Receiving data
4 tables, 800 records
/usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in 'async_exec': PG::Error: ERROR: integer out of range (Sequel::DatabaseError)
from /usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block (2 levels) in execute'
from /usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield'
from /usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `block in execute'
from /usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:158:in `check_disconnect_errors'
from /usr/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `execute'
错误还在继续。
有任何想法吗?
那是我的 database.yml
development:
adapter: postgresql
encoding: unicode
database: aperitime_development
pool: 5
username: willy
password: piero
test:
adapter: postgresql
encoding: unicode
database: aperitime_test
pool: 5
username: willy
password: piero
这是我的 schema.rb
ActiveRecord::Schema.define(:version => 20120630154954) do
create_table "locals", :force => true do |t|
t.string "nome"
t.string "indirizzo"
t.text "descrizione"
t.integer "Tel", :limit => 8
t.integer "voto"
t.string "mappa"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "nome"
t.string "email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "password_digest"
t.string "remember_token"
t.boolean "admin", :default => false
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["remember_token"], :name => "index_users_on_remember_token"
end