Removing Rails & amp; migration
source link: https://www.codesd.com/item/removing-rails-migration.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Removing Rails & amp; migration
If the answer to this has already been discussed, please point me in the right direction. I have searched for this problem, but nothing I have found has worked in my case.
I've created tables that I would like to delete. I have deleted the models and the migrations, but when I attempt to recreate them then migrate, I get the following:
SQLite3::SQLException: table already exists, etc....
I've attempted to use an SQLite
manager to delete them manually, but I'm not sure where the database file is located (other posts didn't help me here either). I am on Win 7
, by the way.
I would like to know the proper way of doing this.
This is another easiest way of creating table and migration again. If you are using rails 3. run this commands to drop database and create it again .
rake db:drop # to drop database
rake db:create # to create same database
rake db:migrate # to migrate the data.
Related Articles
Rails db migrate error aborted while editing a field name after the first migration
Strong parameters in Rails - automatic migration addition
How to create a new table with a unique index in an Active Record / Rails 4 migration
Rails generates migrations
Error Running Ruby on Rails Database Migration
Rails Database Migration Fails with "Duplicate Column Name: E-mail"
Rails 3 migrations: Add a reference column?
Rails & amp; Postgres: Migration to change_colomn gives an error & ldquo; Can not be broadcast to type timestamp without time zone & rdquo;
Rails & amp; SQLite: migration to add a unique index and allow null values
Rails 3: Migrate data
Rails 4 Migration | Add a table with reference
Rails 3 Migration and application.rb
Rails & amp; Rolify: Add a default role to the creative?
Remove constraints in migration migration
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK