Fix technical_specs in sample DB using UNIQUE instead of PRIMARY KEY

This commit is contained in:
Laurence Isla
2024-02-08 14:10:17 -05:00
committed by GitHub
parent 439db880dd
commit 4a0b93c451
+10 -10
View File
@@ -57,11 +57,11 @@ For example, consider a database of films and their awards:
language text
);
CREATE TABLE technical_specs(
film_id INT REFERENCES films UNIQUE,
runtime TIME,
camera TEXT,
sound TEXT
create table technical_specs(
film_id int references films(id) primary key,
runtime time,
camera text,
sound text
);
create table roles(
@@ -216,11 +216,11 @@ One-to-one relationships are detected in two ways.
.. code-block:: postgresql
CREATE TABLE technical_specs(
film_id INT REFERENCES films UNIQUE,
runtime TIME,
camera TEXT,
sound TEXT
create table technical_specs(
film_id int references films(id) unique,
runtime time,
camera text,
sound text
);
.. code-block:: bash