質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

1回答

380閲覧

bundle exec rake db:migrate RAILS_ENV=productionを実行時に出たエラー

退会済みユーザー

退会済みユーザー

総合スコア0

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2018/03/19 03:31

前提・実現したいこと

デプロイ中のエラーでbundle exec rake db:migrate RAILS_ENV=productionを実行させたいです。

発生している問題・エラーメッセージ

-- create_table(:users, {:options=>"ENGINE=InnoDB ROW_FORMAT=DYNAMIC"}) rake aborted! StandardError: An error has occurred, all later migrations canceled: Mysql2::Error: Invalid default value for 'type_of_account': CREATE TABLE `users`

schema

create_table "users", force: :cascade do |t| 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, null: false 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.string "nickname" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "last_name" t.string "last_name_kana" t.string "first_name" t.string "first_name_kana" t.string "profile_image_id" t.string "introduction" t.string "state" t.string "city" t.string "street" t.string "zip" t.string "phone_number1" t.string "phone_number2" t.string "phone_number3" t.string "image_id" t.string "twitter_id" t.string "facebook_id" t.string "instagram_id" t.datetime "deleted_at" t.integer "point", default: 0 t.string "financial_institution_name" t.string "branch_name" t.string "type_of_account", default: "普通口座" t.integer "account_number" t.string "account_holder_name" t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end

エラーに対して

Invalid default value for 'type_of_account':と出ているためデフォルトの設定の仕方が悪いのでしょうか?

###よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

Mysql2::Error: Invalid default value for 'type_of_account': CREATE TABLE users でぐぐるといろいろでてくるとおもいますねー

投稿2019/03/18 01:58

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問