Skip to content

Commit

Permalink
Merge pull request #34956 from kamipo/actionmailbox_datetime_precision
Browse files Browse the repository at this point in the history
Allow using Action Mailbox on MySQL 5.5
  • Loading branch information
kamipo committed Jan 18, 2019
2 parents 41dc4d9 + db077e8 commit 9e4283e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
Expand Up @@ -5,8 +5,11 @@ def change
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
Expand Down
Expand Up @@ -5,8 +5,11 @@ def change
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
Expand Down
10 changes: 5 additions & 5 deletions actionmailbox/test/dummy/db/schema.rb
Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions actiontext/test/dummy/db/schema.rb
Expand Up @@ -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.

Expand Down

0 comments on commit 9e4283e

Please sign in to comment.