Updated examples in the docs after eade315d
.
This commit is contained in:
parent
9d12f68a53
commit
5abc43cabf
|
@ -433,12 +433,12 @@ statements for the polls app):
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
CREATE TABLE "polls_question" (
|
CREATE TABLE "polls_question" (
|
||||||
"id" integer NOT NULL PRIMARY KEY,
|
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
"question_text" varchar(200) NOT NULL,
|
"question_text" varchar(200) NOT NULL,
|
||||||
"pub_date" datetime NOT NULL
|
"pub_date" datetime NOT NULL
|
||||||
);
|
);
|
||||||
CREATE TABLE "polls_choice" (
|
CREATE TABLE "polls_choice" (
|
||||||
"id" integer NOT NULL PRIMARY KEY,
|
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
"question_id" integer NOT NULL REFERENCES "polls_poll" ("id"),
|
"question_id" integer NOT NULL REFERENCES "polls_poll" ("id"),
|
||||||
"choice_text" varchar(200) NOT NULL,
|
"choice_text" varchar(200) NOT NULL,
|
||||||
"votes" integer NOT NULL
|
"votes" integer NOT NULL
|
||||||
|
@ -462,9 +462,9 @@ Note the following:
|
||||||
* The foreign key relationship is made explicit by a ``REFERENCES``
|
* The foreign key relationship is made explicit by a ``REFERENCES``
|
||||||
statement.
|
statement.
|
||||||
|
|
||||||
* It's tailored to the database you're using, so database-specific field
|
* It's tailored to the database you're using, so database-specific field types
|
||||||
types such as ``auto_increment`` (MySQL), ``serial`` (PostgreSQL), or
|
such as ``auto_increment`` (MySQL), ``serial`` (PostgreSQL), or ``integer
|
||||||
``integer primary key`` (SQLite) are handled for you automatically. Same
|
primary key autoincrement`` (SQLite) are handled for you automatically. Same
|
||||||
goes for quoting of field names -- e.g., using double quotes or single
|
goes for quoting of field names -- e.g., using double quotes or single
|
||||||
quotes.
|
quotes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue