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

Prisma is not including columns of Postgres type 'time without time zone' in schema #487

Closed
yim77 opened this issue Sep 3, 2019 · 7 comments
Assignees
Labels
Milestone

Comments

@yim77
Copy link

yim77 commented Sep 3, 2019

Unfortunately Prisma is not including columns of Postgres type 'time without time zone' in schema. These columns are simply missing in schema.

SQL DB Script:

CREATE TABLE public.oeffnungszeiten
(
    id integer NOT NULL DEFAULT nextval('oeffnungszeiten_id_seq'::regclass),
    res_id integer NOT NULL,
    wt integer NOT NULL,
    slot1_von time without time zone NOT NULL,
    slot1_bis time without time zone NOT NULL,
    slot2_von time without time zone,
    slot2_bis time without time zone,
    CONSTRAINT oeffnungszeiten_pkey PRIMARY KEY (id),
    CONSTRAINT fk_oeffnungszeiten_restaurant FOREIGN KEY (res_id)
        REFERENCES public.restaurant (id) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.oeffnungszeiten
    OWNER to postgres;

-- Index: fki_fk_oeffnungszeiten_restaurant

-- DROP INDEX public.fki_fk_oeffnungszeiten_restaurant;

CREATE INDEX fki_fk_oeffnungszeiten_restaurant
    ON public.oeffnungszeiten USING btree
    (res_id)
    TABLESPACE pg_default;

Generated Schema:

model Oeffnungszeiten {
  id  Int        @id
  res Restaurant @map("res_id")
  wt  Int

  @@map("oeffnungszeiten")
}

How should I include this columns?

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Sep 3, 2019
@pantharshit00
Copy link
Contributor

I can confirm this.

@johannesschobel
Copy link
Contributor

that is most likely, because Prisma2 does not have support for DateTime With Timezones. The DateTime Without Timezone is mapped to DateTime type.

I am in desperate need of Timezone Support as well :(

@AhmedElywa
Copy link

I am in desperate need of Timezone Support as well

Me too any update in this

@janpio
Copy link
Member

janpio commented Jan 31, 2020

Just to clarify: Do I understand correctly that you ran prisma2 introspect on your database @yim77 and the time without time zone columns were not represented in the created schema.prisma?

@pantharshit00
Copy link
Contributor

@janpio They are straight missing from the schema

@janpio
Copy link
Member

janpio commented Feb 6, 2020

Related: #1104

@do4gr
Copy link
Member

do4gr commented Feb 20, 2020

I just tested this and they are now in the schema as DateTime. We will still need a more fine grained mapping than just DateTime to represent the different Time/Date types but that is a different issue. I am therefore closing this.

@do4gr do4gr closed this as completed Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants