Skip to content

Commit

Permalink
Use timestamps method in migration files
Browse files Browse the repository at this point in the history
Instead of an database dependent datetime column, we should use the Rails database agnostic timestamps method for creating the columns.
  • Loading branch information
tvdeyen committed May 5, 2020
1 parent 8e32faa commit fb4ac77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
24 changes: 8 additions & 16 deletions db/migrate/20200226213334_alchemy_four_point_four.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def up
t.integer "file_size"
t.references "creator"
t.references "updater"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.string "file_uid"
t.index ["file_uid"], name: "index_alchemy_attachments_on_file_uid"
end
Expand All @@ -33,8 +32,7 @@ def up
t.boolean "public", default: true
t.boolean "folded", default: false
t.boolean "unique", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.references "creator"
t.references "updater"
t.references "parent_element", index: false
Expand Down Expand Up @@ -154,8 +152,7 @@ def up
t.string "frontpage_name"
t.string "page_layout", default: "intro"
t.boolean "public", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.references "creator"
t.references "updater"
t.boolean "default", default: false
Expand All @@ -171,8 +168,7 @@ def up
create_table "alchemy_legacy_page_urls", force: :cascade do |t|
t.string "urlname", null: false
t.references "page", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.index ["urlname"], name: "index_alchemy_legacy_page_urls_on_urlname"
end
end
Expand All @@ -193,8 +189,7 @@ def up
t.references "language", null: false
t.references "creator"
t.references "updater"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.timestamps null: false
t.references "site", null: false
t.index ["lft"], name: "index_alchemy_nodes_on_lft"
t.index ["rgt"], name: "index_alchemy_nodes_on_rgt"
Expand Down Expand Up @@ -222,8 +217,7 @@ def up
t.boolean "robot_follow", default: true
t.boolean "sitemap", default: true
t.boolean "layoutpage", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.references "creator"
t.references "updater"
t.references "language"
Expand All @@ -245,8 +239,7 @@ def up
t.string "image_file_name"
t.integer "image_file_width"
t.integer "image_file_height"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.references "creator"
t.references "updater"
t.string "upload_hash"
Expand All @@ -260,8 +253,7 @@ def up
create_table "alchemy_sites", force: :cascade do |t|
t.string "host"
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.timestamps null: false
t.boolean "public", default: false
t.text "aliases"
t.boolean "redirect_to_primary_host"
Expand Down
28 changes: 14 additions & 14 deletions spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
t.integer "file_size"
t.integer "creator_id"
t.integer "updater_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "file_uid"
t.index ["creator_id"], name: "index_alchemy_attachments_on_creator_id"
t.index ["file_uid"], name: "index_alchemy_attachments_on_file_uid"
Expand All @@ -43,8 +43,8 @@
t.boolean "public", default: true
t.boolean "folded", default: false
t.boolean "unique", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id"
t.integer "updater_id"
t.integer "parent_element_id"
Expand Down Expand Up @@ -152,8 +152,8 @@
t.string "frontpage_name"
t.string "page_layout", default: "intro"
t.boolean "public", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id"
t.integer "updater_id"
t.boolean "default", default: false
Expand All @@ -170,8 +170,8 @@
create_table "alchemy_legacy_page_urls", force: :cascade do |t|
t.string "urlname", null: false
t.integer "page_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["page_id"], name: "index_alchemy_legacy_page_urls_on_page_id"
t.index ["urlname"], name: "index_alchemy_legacy_page_urls_on_urlname"
end
Expand Down Expand Up @@ -224,8 +224,8 @@
t.boolean "robot_follow", default: true
t.boolean "sitemap", default: true
t.boolean "layoutpage", default: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id"
t.integer "updater_id"
t.integer "language_id"
Expand All @@ -248,8 +248,8 @@
t.string "image_file_name"
t.integer "image_file_width"
t.integer "image_file_height"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id"
t.integer "updater_id"
t.string "upload_hash"
Expand All @@ -263,8 +263,8 @@
create_table "alchemy_sites", force: :cascade do |t|
t.string "host"
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "public", default: false
t.text "aliases"
t.boolean "redirect_to_primary_host"
Expand Down

0 comments on commit fb4ac77

Please sign in to comment.