14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsでテーブルを削除したい時の対処法

Last updated at Posted at 2014-09-02

rollbackできない時の対処法。

SQLite3::SQLException: table "users" already exists: CREATE TABLE "hoge"

$rails dbconsole

該当するテーブルを削除
sqlite> drop table hoge;

削除されたか確認する

sqlite> .schema
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");```
14
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?