lundi 18 septembre 2017

Rails 5 Generate devise with already created user table in PostgreSQL

I know that this may have been asked a lot, but the answers are fuzzy in somways... Basically what i wanna know in a direct way, it's how can i link my table key.tbl_ctrl_usuario with the devise gem...

Devise with rails 5

Adding devise gem to rails 4

These are the links that i check, but the answers i cannot understand completly...

I have my database in Postgresql and my table USER it's declared in this way

CREATE TABLE key.tbl_ctrl_usuario
(
  idusuario integer NOT NULL,
  nombreusuario character varying(150) NOT NULL,
  clave character varying(300) NOT NULL,
  rol character varying(50) NOT NULL,
  estado boolean NOT NULL DEFAULT false,
  CONSTRAINT tbl_ctrl_usuario_pkey PRIMARY KEY (idusuario),
  CONSTRAINT tbl_ctrl_usuario_idusuario_fkey FOREIGN KEY (idusuario)
      REFERENCES key.tbl_ctrl_empleados (idempleado) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE key.tbl_ctrl_usuario
  OWNER TO postgres;

Aucun commentaire:

Enregistrer un commentaire