Skip to content

Commit d3159b8

Browse files
committed
mark custom primary keys as experimental for now
I'll revert this change once custom primary keys are supported fully in Piccolo admin
1 parent e193555 commit d3159b8

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

docs/src/piccolo/schema/defining.rst

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ For a full list of columns, see :ref:`ColumnTypes`.
2424
-------------------------------------------------------------------------------
2525

2626
Primary Key
27-
---------------
27+
-----------
2828

29-
You can specify your ``PrimaryKey`` with any column type by passing ``primary_key`` to the ``Column``.
29+
Piccolo tables are automatically given a primary key column called ``id``,
30+
which is an auto incrementing integer.
3031

31-
It is used to uniquely identify a row, and is referenced by ``ForeignKey``
32-
columns on other tables.
32+
There is currently experimental support for specifying a custom primary key
33+
column. For example:
3334

3435
.. code-block:: python
3536
@@ -42,22 +43,6 @@ columns on other tables.
4243
id = UUID(primary_key=True)
4344
name = Varchar(length=100)
4445
45-
If you don't specify a ``PrimaryKey``, the table is automatically given a ``PrimaryKey`` column called ``id``, which
46-
is an auto incrementing integer.
47-
48-
This is equivalent to:
49-
50-
.. code-block:: python
51-
52-
# tables.py
53-
from piccolo.table import Table
54-
from piccolo.columns import Serial, Varchar
55-
56-
57-
class Band(Table):
58-
id = Serial(primary_key=True)
59-
name = Varchar(length=100)
60-
6146
-------------------------------------------------------------------------------
6247

6348
Tablename

0 commit comments

Comments
 (0)