Это файл миграции.
Я сделал метки времени поля автоматически сгенерирован .
class CreateCustomerOrders < ActiveRecord::Migration[6.0]
def change
create_table :customer_orders do |t|
t.bigint :order_id
t.string :customer_email
t.timestamps, default: -> { 'NOW()' }
end
end
end
Это трассировки стека ошибок .
rake aborted!
SyntaxError: /work/halfhelix/rewardbee/heroku-rewardbee-migration-app/db/migrate/primary/20200119193709_create_customer_orders.rb:8: syntax error, unexpected tLABEL, expecting '='
t.timestamps, default: -> { 'NOW()' }
^~~~~~~~
/Users/admin/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1010:in `load_migration'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1006:in `migration'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1001:in `disable_ddl_transaction'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1369:in `use_transaction?'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1310:in `execute_migration_in_transaction'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1269:in `run_without_lock'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1221:in `block in run'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1221:in `run'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/migration.rb:1075:in `run'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/activerecord-6.0.1/lib/active_record/railties/databases.rake:155:in `block (5 levels) in <top (required)>'
/Users/admin/.rvm/gems/ruby-2.5.3/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/admin/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
/Users/admin/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
Я не уверен, почему я получаю эту проблему. У кого-нибудь была эта проблема раньше?