summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial01.txt
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2015-03-29 16:59:35 +0200
committerMarkus Holtermann <info@markusholtermann.eu>2015-03-30 16:31:20 +0200
commitc5cc332bf2a0b3ebfa3ad5d26c5b308de5e505be (patch)
tree58e095966c96de38f50a96ab94386db80d9fa78a /docs/intro/tutorial01.txt
parentdc27f3ee0c3eb9bb17d6cb764788eeaf73a371d7 (diff)
Fixed #24550 -- Added migration operation description to sqlmigrate output
Thanks Tim Graham for the review.
Diffstat (limited to 'docs/intro/tutorial01.txt')
-rw-r--r--docs/intro/tutorial01.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
index 8fd59408eb..9f728207ca 100644
--- a/docs/intro/tutorial01.txt
+++ b/docs/intro/tutorial01.txt
@@ -446,8 +446,8 @@ You should see something similar to the following:
Migrations for 'polls':
0001_initial.py:
- - Create model Question
- Create model Choice
+ - Create model Question
- Add field question to choice
By running ``makemigrations``, you're telling Django that you've made
@@ -476,16 +476,25 @@ readability):
.. code-block:: sql
BEGIN;
+ --
+ -- Create model Choice
+ --
CREATE TABLE "polls_choice" (
"id" serial NOT NULL PRIMARY KEY,
"choice_text" varchar(200) NOT NULL,
"votes" integer NOT NULL
);
+ --
+ -- Create model Question
+ --
CREATE TABLE "polls_question" (
"id" serial NOT NULL PRIMARY KEY,
"question_text" varchar(200) NOT NULL,
"pub_date" timestamp with time zone NOT NULL
);
+ --
+ -- Add field question to choice
+ --
ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT NULL;
ALTER TABLE "polls_choice" ALTER COLUMN "question_id" DROP DEFAULT;
CREATE INDEX "polls_choice_7aa0f6ee" ON "polls_choice" ("question_id");