Question: I'm practicing methods, but the problem is I want to separate inputting and sorting, the display method will be the main, I'm having trouble fixing this calling from other class.

This is my script :

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CaseProblem
{
    class Method
    {
        static void MethodInput()
        {
            int[] array = new int[5];
            int i;
            // loop for accepting values in array
            for (i = 0; i < 5; i++)
            {
                Console.Write("Enter number:\t");
                array[i] = int.Parse(Console.ReadLine());
            }
        }
        public static void MethodSort()
        {
            foreach (int i in array)
            {
                Console.Write(" {0}", i);
            }
        }
    }
    class Program
    {
        static void Main(int[]array)
        {
            //sorting array value;
            Array.Sort(array); //use array's sort function

            Method.MethodSort(array);
            Console.ReadLine();
        }
    }
}

```

Thank you for your help

Answer: 
There are two steps to migrations in Django. 

```
./manage.py makemigrations

```

will create the migration files that you see - these describe the changes that should be made to the database. 

You also need to run 

```
./manage.py migrate 

```

this will apply the migrations and actually run the alter table commands in SQL to change the actual database structure. 

Generally adding fields or tables won't affect anything else in the database. Be more careful when altering or deleting existing fields as that can affect your data.

The reason for two steps is so that you can make changes on a dev machine and once happy commit the migration files and release to your production environment. Then you run the migrate command on your production machine to bring the production database to the same state as your dev machine (no need for makemigrations on production assuming that your databases started the same).
I solved it simply, changing the name of the new model to the original name, and then I checked if there is the table in the database, if not, I just create a new table with the old name with just a field like id.
And then clear migrations and create new migrations, migrate and verify table was fixed in DB and has all missing fields.
If it still doesn't work, then change the model name back to a new one.
but when django asks you if you are renaming the model you should say NO to get the old one removed properly and create a new one.

This type of error usually occurs when you delete some table in dB manually, and then the migration history changes in the tables are lost.
But it is not necessary to erase the entire database and start from scratch.