December 2018
Beginner to intermediate
796 pages
19h 54m
English
The toys_toy table persists in the database the Toy class we recently created, specifically, the Toy model. Django's integrated ORM generated the toys_toy table based on our Toy model.
Run the following command to retrieve the SQL used to create the toys_toy table:
sqlite3 db.sqlite3 ".schema toys_toy"
The following lines show the output for the previous command together with the SQL that the migrations process executed, to create the toys_toy table that persists the Toy model. The next lines are formatted to make it easier to understand the SQL code. Notice that the output from the command is formatted in a different way:
CREATE TABLE IF NOT EXISTS "toys_toy"
(
"id" integer NOT NULL PRIMARY ...Read now
Unlock full access