haskell-beam / haskell-beam/beam

improve Postgres example with foreign keys

Open
#735 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Related:
- #502
- https://github.com/haskell-beam/beam/issues/587
- https://github.com/haskell-beam/beam/discussions/715
-
I think the Postgres example does not implement foreign keys. Using the discussions above maybe it can be done.

```
postgres=# \d address
Table "public.address"
Column | Type | Collation | Nullable | Default
-------------+-----------------------------+-----------+----------+---------------------------------------------
address_id | smallint | | not null | nextval('address_address_id_seq'::regclass)
address | character varying(50) | | not null |
address2 | character varying(50) | | |
district | character varying(20) | | not null |
city_id | smallint | | not null |
postal_code | character varying(10) | | |
phone | character varying(20) | | not null |
last_update | timestamp without time zone | | not null | now()
Indexes:
"address_pkey" PRIMARY KEY, btree (address_id)

postgres=# \d city
Table "public.city"
Column | Type | Collation | Nullable | Default
-------------+-----------------------------+-----------+----------+---------
city_id | smallint | | not null |
city | character varying(50) | | not null |
country_id | smallint | | not null |
last_update | timestamp without time zone | | not null | now()
Indexes:
"city_pkey" PRIMARY KEY, btree (city_id)

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.