Yii Framework Forum: Does gii Build Relations option work with postgre? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Does gii Build Relations option work with postgre? Rate Topic: -----

#1 User is offline   Dimitar Chakarov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 22-December 10
  • Location:Burgas, Bulgaria

Posted 03 February 2012 - 12:01 PM

Hi, I am trying to create my models for a postgre database using gii and everything works great but when I open them there are no relations generated. I have the "Build Relations" checked and there are foreign keys created in my tables. For example:

CREATE TABLE web.material_code
(
  material_id integer NOT NULL,
  code_id integer NOT NULL,
  CONSTRAINT "PK_material_code" PRIMARY KEY (material_id, code_id),
  CONSTRAINT material_code_code_id_fkey FOREIGN KEY (code_id)
      REFERENCES web.code (code_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT material_code_material_id_fkey FOREIGN KEY (material_id)
      REFERENCES web.material (material_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)


It's my first time dealing with postgre, my other projects all run on mysql and there were no such problems.
Can you help me?
0

#2 User is offline   Arnaud 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 21-February 12

Posted 04 April 2012 - 09:47 PM

Same here - Relations are not being created from my PostGres database (which uses foreign keys). I am using both Gii and Gixx.

Does anyone have encountered that issue as well?

Thank you,

View PostDimitar Chakarov, on 03 February 2012 - 12:01 PM, said:

Hi, I am trying to create my models for a postgre database using gii and everything works great but when I open them there are no relations generated. I have the "Build Relations" checked and there are foreign keys created in my tables. For example:

CREATE TABLE web.material_code
(
  material_id integer NOT NULL,
  code_id integer NOT NULL,
  CONSTRAINT "PK_material_code" PRIMARY KEY (material_id, code_id),
  CONSTRAINT material_code_code_id_fkey FOREIGN KEY (code_id)
      REFERENCES web.code (code_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT material_code_material_id_fkey FOREIGN KEY (material_id)
      REFERENCES web.material (material_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)


It's my first time dealing with postgre, my other projects all run on mysql and there were no such problems.
Can you help me?

0

#3 User is offline   Zugluk 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 205
  • Joined: 08-August 12

Posted 16 October 2012 - 09:57 AM

This topic is a bit old but I'm facing the same problem actually...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users