Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我在mysql中没有看到任何字段_Mysql_Ruby On Rails_Rails Migrations - Fatal编程技术网

我在mysql中没有看到任何字段

我在mysql中没有看到任何字段,mysql,ruby-on-rails,rails-migrations,Mysql,Ruby On Rails,Rails Migrations,我使用terminal CreateUsers创建了简单的迁移类 class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.column "first_name", :string, :limit => 25 t.string "last_name", :limit => 25 t

我使用terminal CreateUsers创建了简单的迁移类

        class CreateUsers < ActiveRecord::Migration
         def up
       create_table :users do |t|
        t.column "first_name", :string, :limit => 25
        t.string "last_name",  :limit => 25
        t.string "email", :default => "" :null => false
        t.string "password",  :limit => 40  
    t.timestamps
     end
end

def down
    drop_table :users
end
end
在那之后,我渴望进入mysql帐户。当我显示我的用户字段时,我只看到ID和时间戳字段

我想知道为什么我不能看到名字、姓氏、电子邮件和密码字段


谢谢

在命令行中,输入db控制台rails dbconsole,然后键入PRAGMA table_infousers;。它说什么?@JTG ERROR 1064 42000:您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以了解在第1行“PRAGMA table_infousers”附近使用的正确语法。我修复了代码。在终端rake db:migrate:redo上运行之后,我丢失了一封逗号t.string电子邮件:default=>:null=>false
rake db:migrate