We can now update the new ATM locations model inside the Django app, as follows:
- We will write the following makemigrations command, which is used to create the ATM locations model:
(venv) [root@ip-172-31-95-213 atmproject]# python3.7 manage.py makemigrations atmapp
Migrations for 'atmapp':
atmapp/migrations/0001_initial.py
- Create model ATMlocations
- We will generate the SQL of ATMlocations using the sqlmigrate command:
(venv) [root@ip-172-31-95-213 atmproject]# python3.7 manage.py sqlmigrate atmapp 0001
BEGIN;
--
-- Create model ATMlocations
--
CREATE TABLE "ATM locations" ("ID" serial NOT NULL PRIMARY KEY, "BankName" varchar(60) NOT NULL, "Address" varchar(50) NOT NULL, "County" varchar(15) NOT NULL, "City" varchar(15) NOT NULL, "State" varchar(2) NOT NULL, "ZipCode" integer NOT NULL);
COMMIT;
- We will apply the migration to the PostgreSQL RDS, as shown in the following...