本番環境で MySQL を実行し、開発環境で SQLite を実行している Rails アプリケーションがあります。開発モードではすべて正常に動作しますが、本番環境では日時プロパティがデータベースに保存されません (created_at と updated_at も保存されません)。フィールドはnull
ではなく0000-00-00 00:00:00
です。これはどのように可能ですか?色々調べましたが直りません。
スキーマ.rb:
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130306100623) do
create_table "announcements", :force => true do |t|
t.string "title"
t.text "text"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "delayed_jobs", :force => true do |t|
t.integer "priority", :default => 0
t.integer "attempts", :default => 0
t.text "handler"
t.text "last_error"
t.datetime "run_at"
t.datetime "locked_at"
t.datetime "failed_at"
t.string "locked_by"
t.string "queue"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "document_categories", :force => true do |t|
t.string "title"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t|
t.string "file_file_name"
t.string "file_content_type"
t.integer "file_file_size"
t.datetime "file_updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "user_id"
t.string "title"
t.text "description"
t.string "ancestry"
t.boolean "folder"
end
add_index "documents", ["ancestry"], :name => "index_documents_on_ancestry"
create_table "inventory_items", :force => true do |t|
t.string "object"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "reservation_items", :force => true do |t|
t.integer "reservation_id"
t.integer "inventory_item_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "reservations", :force => true do |t|
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "start_time"
t.datetime "end_time"
end
create_table "users", :force => true do |t|
t.string "first_name"
t.string "insertion"
t.string "last_name"
t.string "telephone_prefix"
t.string "telephone_suffix"
t.string "address"
t.string "number"
t.string "postal_code"
t.string "city"
t.date "birthdate"
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "telephone_mobile"
t.integer "admin"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.string "sex"
t.string "lovo_email"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end
どうもありがとうございます!