How to delete the database when recreating the application

When I was doing personal development, I got confused, so I decided to delete the application once. I would like to describe what I found there.

There are two ways to erase

The first way to erase

This is the method before turning off the app.

This method cannot be used after erasing.
rails db:drop

You can now erase it. I also did this. But I couldn't do it well, so I tried another method.

The second way to erase

I use sequel pro to manage my database, so I use sequel pro to erase it.

cd

Return to your home directory once

mysql -u root

Get into the sequel pro

drop database application name;

You can delete the database by writing. But for some reason only the development file was gone next,

drop database application name_development;
drop database application name_test;

I was able to successfully clear the database by typing

Recommended Posts

How to delete the database when recreating the application
How to add the delete function
How to delete the wrong migration file
How to delete the migration file NO FILE
[For beginners] How to implement the delete function
[Java / PostgreSQL] Connect the WEB application to the database
How to delete / update the list field of OneToMany
How to delete BOM (UTF-8)
How to set chrony when the time shifts in CentOS7
How to cure the time dilation when launching Japaneseized Kibana
How to get the log when install4j does not start
[Docker] How to forcibly disconnect the session connected to the database [Postgres]
[Rails] How to display information stored in the database in view
How to check the database of apps deployed on Heroku
How to use the link_to method
How to use the include? method
Dynamically switch the database to connect to
How to use the form_with method
How to find the average angle
How to use the wrapper class
[Beginner] How to delete NO FILE
How to output the value when there is an array in the array
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku
[Swift UI] How to get the startup status of the application [iOS]
[jOOQ] How to CASE WHEN in the WHERE / AND / OR clause
How to solve the unknown error when using slf4j in Java
[Rails] How to reset the database in production environment (Capistrano version)
[Rails 5] How to display the password change screen when using devise
How to write the view when Vue is introduced in Rails?
[Java] How to use the File class
I tried to summarize the stumbling points when developing an Android application
[Java] How to use the hasNext function
How to put out the error bundling
[Java] How to use the HashMap class
[Rails] How to use the map method
How to publish an application on Heroku
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
How to resolve errors when installing Rails 5.1.3
How to determine the number of parallels
[Java] How to set the Date time to 00:00:00
[Java] How to get the current directory
[Swift] How to implement the countdown function
How to change the timezone on Ubuntu
[Docker] How to build when the source code is bind-mounted on the container
Ransack sort_link How to change the color!
[Processing × Java] How to use the class
How to find the total number of pages when paging in Java
How to sort the List of SelectItem
How to install the legacy version [Java]
How to find the tens and ones
How to pass the value to another screen
How to get the date in java
How to constrain the action of the transition destination when not logged in
How to get the setting value (property value) from the database in Spring Framework
I want to display an error message when registering in the database
[Processing × Java] How to use the function
How to delete data with foreign key
[Java] How to use the Calendar class
Summarized how to climb the programming stairs