Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve Postgres example with foreign keys #735

Open
peterbecich opened this issue Dec 25, 2024 · 0 comments
Open

improve Postgres example with foreign keys #735

peterbecich opened this issue Dec 25, 2024 · 0 comments

Comments

@peterbecich
Copy link
Contributor

peterbecich commented Dec 25, 2024

Related:

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)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant