내가 3 열 URL, 가격과 타임 스탬프가있는 테이블을 만들려고하고 생성하지 ... 내가 DB를 실행dB : 마이그레이션 테이블이
class Shp < ActiveRecord::Base
def change
create_table :shps do |t|
t.string :url
t.float :price
t.timestamps
end
end
end
"까지" "변화"를 모두 시도 : 마이그레이션이 보인다 내가 할 때와 같이 아무 일도하지 말아라.
ActiveRecord::Base.connection.column_names("shps")
나는 기본 열만있는 테이블을 얻는다.
=> [#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x8fc8a34 @name="id", @sql_type="INTEGER", @null=false, @limit=nil, @precision=nil, @scale=nil, @type=:integer, @default=nil, @primary=nil, @coder=nil>, #<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x8fc878c @name="created_at", @sql_type="datetime", @null=false, @limit=nil, @precision=nil, @scale=nil, @type=:datetime, @default=nil, @primary=nil, @coder=nil>, #<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x8fc8444 @name="updated_at", @sql_type="datetime", @null=false, @limit=nil, @precision=nil, @scale=nil, @type=:datetime, @default=nil, @primary=nil, @coder=nil>]
을 당신은 "콜루 (colu)"방법으로 테스트합니다. mn_names "테이블의': shps'의 존재? 어쩌면 당신은 Ruby (PostGreSQL 용 PGAdmin3 등)보다 다른 도구를 통해 확인할 수 있습니다. – MrYoshiji