I이 마이그레이션 파일이 있습니다MySQL 데이터베이스 마이그레이션 레일에 실패
class InitialDigitizationWork < ActiveRecord::Migration
def self.up
create_table :digitizations do |t|
t.string :submission_code, :null => false
t.timestamps
end
add_index :digitizations, :submission_code, :unique => true
create_table :digitized_pieces do |t|
t.integer :digitization_id, :null => false
t.integer :position, :null => false
t.string :piece_type, :default => "Page"
t.timestamps
end
add_index :digitized_pieces, :digitization_id
create_table :digitized_views do |t|
t.integer :digitized_piece_id, :null => false
t.string :initial_file_name
t.string :attachment_file_name
t.string :attachment_content_type
t.integer :attachment_file_size
t.datetime :attachment_updated_at
t.integer :position, :null => false
t.boolean :is_primary, :default => false
t.timestamps
end
add_index :digitized_views, :digitized_piece_id, :null => false
end
을하고 마지막 줄에 실패
-- 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,
사람은 무슨 일이 일어나고 있는지 어떤 생각을 가지고?
여기 마지막으로 실패한 이후로 테이블 상단에 digitizations
이 있으므로 마이그레이션을 다시 다시 시작할 수 없습니다.
#SQLite version 3.x
#gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: mysql2
database: arthouse_development
username: root
password:
host: localhost
port: 3306
#socket: /tmp/mysql.sock
legacy_development:
adapter: mysql2
database: arthouse_legacy_development
username: root
password:
host: localhost
port: 3306
누구든지 내가 여기에 데이터베이스에 콘솔 수있는 방법을 알고 : 나는 PostgreSQL을 사용하고이 yml
파일에 의해 지정된 생성 된 특정 테이블에 액세스하는 방법을 알아?
누구에게 무슨 일이 일어날 지 알고 있습니까? 이것은 처음으로 mysql
을 사용하며 도움을받을 수 있습니다.
mysql
ERROR 1045 (28000): Access denied for user 'jwan'@'localhost' (using password: NO)
을하지만,이 작품 : 나는 mysql
에 입력 할 때
또한이 발생
mysql -u root
내가 그 때마다 작업을 수행해야합니까?
rake db:rollback
는 그런 다음 인덱스에
default=> null
제약 조건을 제거 : 당신은 백지 상태에서 시작하도록
먼저 마지막 마이그레이션을 롤백 : 그래서 여기에 좋아
이 바람을했던 방법을 여기에 처음부터? 방금이 코드베이스를 뽑았습니다. 어떻게이게 여기에 왔는지에 관한 이론은 없습니까? – Jwan622
무슨 뜻인지 미안합니다. 무슨 일이야? – Cyzanfar
Like ...이 코드베이스의 제작이 작동합니다. 그럼이 이주는 어떻게 여기에서 끝났습니까? – Jwan622