Fix technical_specs in sample DB using UNIQUE instead of PRIMARY KEY
This commit is contained in:
@@ -57,11 +57,11 @@ For example, consider a database of films and their awards:
|
|||||||
language text
|
language text
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE technical_specs(
|
create table technical_specs(
|
||||||
film_id INT REFERENCES films UNIQUE,
|
film_id int references films(id) primary key,
|
||||||
runtime TIME,
|
runtime time,
|
||||||
camera TEXT,
|
camera text,
|
||||||
sound TEXT
|
sound text
|
||||||
);
|
);
|
||||||
|
|
||||||
create table roles(
|
create table roles(
|
||||||
@@ -216,11 +216,11 @@ One-to-one relationships are detected in two ways.
|
|||||||
|
|
||||||
.. code-block:: postgresql
|
.. code-block:: postgresql
|
||||||
|
|
||||||
CREATE TABLE technical_specs(
|
create table technical_specs(
|
||||||
film_id INT REFERENCES films UNIQUE,
|
film_id int references films(id) unique,
|
||||||
runtime TIME,
|
runtime time,
|
||||||
camera TEXT,
|
camera text,
|
||||||
sound TEXT
|
sound text
|
||||||
);
|
);
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user