Recreating database after modifying django models

Sometimes I needed to change my django models, and it might create error that certain column cannot be found. If you have not much data yet, the simplest is to recreate the database. This is the step:

Go to mysql client:

<pre>$ mysql -u root -p mysql</pre>

Show the databse

<pre>mysql> show databases;</pre>

Drop the database

<pre>mysql>drop database databasename;</pre>

Create database

<pre>mysql>create database databasename;</pre>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: