gpt4 book ai didi

mysql - 在 mysql2 上迁移的问题。 rails

转载 作者:行者123 更新时间:2023-11-29 10:32:53 24 4
gpt4 key购买 nike

我正在运行bundle exec rake db:create,然后运行bundle exec rake db:migrate`,在迁移时遇到此错误:

 bundle exec rake db:migrate
== 20110125192211 InitialDigitizationWork: migrating ==========================
-- create_table(:digitizations)
-> 0.0170s
-- add_index(:digitizations, :submission_code, {:unique=>true})
-> 0.0156s
-- create_table(:digitized_pieces)
-> 0.0180s
-- add_index(:digitized_pieces, :digitization_id)
-> 0.0113s
-- create_table(:digitized_views)
-> 0.0235s
-- add_index(:digitized_views, :digitized_piece_id, {:null=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Unknown key: :null. Valid keys are: :unique, :order, :name, :where, :length, :internal, :using, :algorithm,

这是我第一次使用Mysql(我习惯了Postgresql)我好像有Mysql:

 mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 5.7.20 Homebrew

这是我的database.yml 文件:

development:
adapter: mysql2
database: arthouse_dev
username: root
password:
host: localhost
port: 3306
#socket: /tmp/mysql.sock

legacy_development:
adapter: mysql2
database: arthouse_leg_development
username: root
password:
host: localhost
port: 3306

最佳答案

我相信这只是一个错误,索引不能使用 null: false

关于mysql - 在 mysql2 上迁移的问题。 rails ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47064783/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com