Changeset 1465
- Timestamp:
- 11/27/05 13:28:38 (3 years ago)
- Files:
-
- django/trunk/docs/tutorial01.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial01.txt
r1285 r1465 228 228 229 229 BEGIN; 230 CREATE TABLE polls_polls(231 idserial NOT NULL PRIMARY KEY,232 questionvarchar(200) NOT NULL,233 pub_datetimestamp with time zone NOT NULL230 CREATE TABLE "polls_polls" ( 231 "id" serial NOT NULL PRIMARY KEY, 232 "question" varchar(200) NOT NULL, 233 "pub_date" timestamp with time zone NOT NULL 234 234 ); 235 CREATE TABLE polls_choices(236 idserial NOT NULL PRIMARY KEY,237 poll_id integer NOT NULL REFERENCES polls_polls (id),238 choicevarchar(200) NOT NULL,239 votesinteger NOT NULL235 CREATE TABLE "polls_choices" ( 236 "id" serial NOT NULL PRIMARY KEY, 237 "poll_id" integer NOT NULL REFERENCES "polls_polls" ("id"), 238 "choice" varchar(200) NOT NULL, 239 "votes" integer NOT NULL 240 240 ); 241 241 COMMIT; … … 256 256 * It's tailored to the database you're using, so database-specific field types 257 257 such as ``auto_increment`` (MySQL), ``serial`` (PostgreSQL), or ``integer 258 primary key`` (SQLite) are handled for you automatically. The author of 259 this tutorial runs PostgreSQL, so the example output is in PostgreSQL 260 syntax. 258 primary key`` (SQLite) are handled for you automatically. Same goes for 259 quoting of field names -- e.g., using double quotes or single quotes. The 260 author of this tutorial runs PostgreSQL, so the example output is in 261 PostgreSQL syntax. 261 262 262 263 If you're interested, also run the following commands:
