diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-01-18 09:56:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 09:56:57 +0900 |
commit | 9e4283eb1d158ada3395d289228f128f6a56ff32 (patch) | |
tree | 2e30f633da0ce2424a065223577fc14fd6b5287d | |
parent | 41dc4d94907914ad8e75444bd3e0ea0a598bfea1 (diff) | |
parent | db077e8090623801721d574263c57b2641698e7e (diff) | |
download | rails-9e4283eb1d158ada3395d289228f128f6a56ff32.tar.gz rails-9e4283eb1d158ada3395d289228f128f6a56ff32.tar.bz2 rails-9e4283eb1d158ada3395d289228f128f6a56ff32.zip |
Merge pull request #34956 from kamipo/actionmailbox_datetime_precision
Allow using Action Mailbox on MySQL 5.5
-rw-r--r-- | actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb | 7 | ||||
-rw-r--r-- | actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailbox_tables.rb (renamed from actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb) | 7 | ||||
-rw-r--r-- | actionmailbox/test/dummy/db/schema.rb | 10 | ||||
-rw-r--r-- | actiontext/test/dummy/db/schema.rb | 10 |
4 files changed, 20 insertions, 14 deletions
diff --git a/actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb b/actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb index 550cc0e4e5..89ab66c1a9 100644 --- a/actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb +++ b/actionmailbox/db/migrate/20180917164000_create_action_mailbox_tables.rb @@ -5,8 +5,11 @@ class CreateActionMailboxTables < ActiveRecord::Migration[6.0] t.string :message_id, null: false t.string :message_checksum, null: false - t.datetime :created_at, precision: 6, null: false - t.datetime :updated_at, precision: 6, null: false + if supports_datetime_with_precision? + t.timestamps precision: 6 + else + t.timestamps + end t.index [ :message_id, :message_checksum ], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true end diff --git a/actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb b/actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailbox_tables.rb index 550cc0e4e5..89ab66c1a9 100644 --- a/actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailroom_tables.rb +++ b/actionmailbox/test/dummy/db/migrate/20180208205311_create_action_mailbox_tables.rb @@ -5,8 +5,11 @@ class CreateActionMailboxTables < ActiveRecord::Migration[6.0] t.string :message_id, null: false t.string :message_checksum, null: false - t.datetime :created_at, precision: 6, null: false - t.datetime :updated_at, precision: 6, null: false + if supports_datetime_with_precision? + t.timestamps precision: 6 + else + t.timestamps + end t.index [ :message_id, :message_checksum ], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true end diff --git a/actionmailbox/test/dummy/db/schema.rb b/actionmailbox/test/dummy/db/schema.rb index 8a11c3fbe1..10d4111a89 100644 --- a/actionmailbox/test/dummy/db/schema.rb +++ b/actionmailbox/test/dummy/db/schema.rb @@ -2,11 +2,11 @@ # 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). +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. diff --git a/actiontext/test/dummy/db/schema.rb b/actiontext/test/dummy/db/schema.rb index 39216ebd23..7f8f4dff4e 100644 --- a/actiontext/test/dummy/db/schema.rb +++ b/actiontext/test/dummy/db/schema.rb @@ -2,11 +2,11 @@ # 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). +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. |