Questions tagged «mysql-error-1146»

7
在Laravel迁移文件中填充数据库
我正在学习Laravel,并且有一个有效的迁移文件创建了一个users表。我正在尝试在迁移过程中填充用户记录: public function up() { Schema::create('users', function($table){ $table->increments('id'); $table->string('email', 255); $table->string('password', 64); $table->boolean('verified'); $table->string('token', 255); $table->timestamps(); DB::table('users')->insert( array( 'email' => 'name@domain.com', 'verified' => true ) ); }); } 但是运行时出现以下错误php artisan migrate: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vantage.users' doesn't exist 显然这是因为Artisan尚未创建表,但是所有文档似乎都说有一种方法可以使用Fluent Query来填充数据,作为迁移的一部分。 有人知道吗?谢谢!

25
Mysql 1050错误“表已存在”实际上不存在
我要添加此表: CREATE TABLE contenttype ( contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT, class VARBINARY(50) NOT NULL, packageid INT UNSIGNED NOT NULL, canplace ENUM('0','1') NOT NULL DEFAULT '0', cansearch ENUM('0','1') NOT NULL DEFAULT '0', cantag ENUM('0','1') DEFAULT '0', canattach ENUM('0','1') DEFAULT '0', isaggregator ENUM('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (contenttypeid), …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.