Update of /cvsroot/sqlobject/SQLObject/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv32081
Modified Files:
SQLObject.txt
Log Message:
Note SERIAL PRIMARY KEY for pg
Index: SQLObject.txt
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/docs/SQLObject.txt,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** SQLObject.txt 9 Apr 2003 04:34:45 -0000 1.9
--- SQLObject.txt 17 Apr 2003 03:39:08 -0000 1.10
***************
*** 130,134 ****
CREATE TABLE person (
! id SERIAL,
first_name VARCHAR(100) NOT NULL,
middle_initial CHAR(1),
--- 130,134 ----
CREATE TABLE person (
! id SERIAL PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
middle_initial CHAR(1),
***************
*** 195,200 ****
You'll note that the ``id`` column is not given in the class
definition, it is implied. For MySQL databases it should be defined
! as ``INT PRIMARY KEY AUTO_INCREMENT``, in Postgres ``SERIAL``, and in
! SQLite as ``INTEGER PRIMARY KEY``.
Using the Class
--- 195,200 ----
You'll note that the ``id`` column is not given in the class
definition, it is implied. For MySQL databases it should be defined
! as ``INT PRIMARY KEY AUTO_INCREMENT``, in Postgres ``SERIAL PRIMARY KEY``,
! and in SQLite as ``INTEGER PRIMARY KEY``.
Using the Class
***************
*** 382,387 ****
The name of the primary key column (default ``id``).
! Relations Between Classes/Tables
! --------------------------------
You can use the `foreignKey` argument to `Col` to handle simple
--- 382,387 ----
The name of the primary key column (default ``id``).
! Relationships Between Classes/Tables
! ------------------------------------
You can use the `foreignKey` argument to `Col` to handle simple
***************
*** 389,397 ****
many-to-many references you'll use joins.
! Relations: One-to-Many
! ~~~~~~~~~~~~~~~~~~~~~~
! Now we'll deal with having a relation to another table, a phone number
! table that refers to a person::
CREATE TABLE phone_number (
--- 389,397 ----
many-to-many references you'll use joins.
! Relationships: One-to-Many
! ~~~~~~~~~~~~~~~~~~~~~~~~~~
! Now we'll deal with having a relationship to another table, a phone
! number table that refers to a person::
CREATE TABLE phone_number (
***************
*** 437,442 ****
.. _Many-to-Many:
! Relations: Many-to-Many
! ~~~~~~~~~~~~~~~~~~~~~~~
We'll add roles to the system, where a person can have more than one
--- 437,442 ----
.. _Many-to-Many:
! Relationships: Many-to-Many
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
We'll add roles to the system, where a person can have more than one
***************
*** 836,840 ****
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! To create a database call `createTable`. It takes two arguments:
`ifNotExists`:
--- 836,840 ----
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! To create a table call `createTable`. It takes two arguments:
`ifNotExists`:
***************
*** 842,846 ****
False.
`createJoinTables`:
! If you used Many-to-Many_ relations, then the intermediate tables
will be created (but only for one of the two involved classes).
Default True.
--- 842,846 ----
False.
`createJoinTables`:
! If you used Many-to-Many_ relationships, then the intermediate tables
will be created (but only for one of the two involved classes).
Default True.
|