summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial02.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/intro/tutorial02.txt')
-rw-r--r--docs/intro/tutorial02.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt
index df595e947c..ee0707456d 100644
--- a/docs/intro/tutorial02.txt
+++ b/docs/intro/tutorial02.txt
@@ -274,7 +274,7 @@ readability):
-- Create model Question
--
CREATE TABLE "polls_question" (
- "id" serial NOT NULL PRIMARY KEY,
+ "id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
"question_text" varchar(200) NOT NULL,
"pub_date" timestamp with time zone NOT NULL
);
@@ -282,10 +282,10 @@ readability):
-- Create model Choice
--
CREATE TABLE "polls_choice" (
- "id" serial NOT NULL PRIMARY KEY,
+ "id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
"choice_text" varchar(200) NOT NULL,
"votes" integer NOT NULL,
- "question_id" integer NOT NULL
+ "question_id" bigint NOT NULL
);
ALTER TABLE "polls_choice"
ADD CONSTRAINT "polls_choice_question_id_c5b4b260_fk_polls_question_id"
@@ -315,10 +315,10 @@ Note the following:
PostgreSQL to not enforce the foreign key until the end of the transaction.
* It's tailored to the database you're using, so database-specific field types
- such as ``auto_increment`` (MySQL), ``serial`` (PostgreSQL), or ``integer
- primary key autoincrement`` (SQLite) are handled for you automatically. Same
- goes for the quoting of field names -- e.g., using double quotes or
- single quotes.
+ such as ``auto_increment`` (MySQL), ``bigint PRIMARY KEY GENERATED BY DEFAULT
+ AS IDENTITY`` (PostgreSQL), or ``integer primary key autoincrement`` (SQLite)
+ are handled for you automatically. Same goes for the quoting of field names
+ -- e.g., using double quotes or single quotes.
* The :djadmin:`sqlmigrate` command doesn't actually run the migration on your
database - instead, it prints it to the screen so that you can see what SQL