Código SQL:
Ver originalCREATE TABLE rrhh.nomina
(
id BIGINT NOT NULL,
anno INTEGER NOT NULL,
deleted TIMESTAMP WITHOUT TIME zone,
mes INTEGER NOT NULL,
security_domain_id BIGINT,
version INTEGER,
empleado BIGINT,
fichero BIGINT,
CONSTRAINT nomina_pkey PRIMARY KEY (id),
CONSTRAINT fk_nomina_empleado FOREIGN KEY (empleado)
REFERENCES rrhh.empleado (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_nomina_fichero FOREIGN KEY (fichero)
REFERENCES rrhh.fichero (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT nomina_anno_check CHECK (anno >= 2000 AND anno <= 2050),
CONSTRAINT nomina_mes_check CHECK (mes >= 1 AND mes <= 12)
)
Al mirar desde pgAdmin veo la tabla con una constraint "nomina_mes_check", que esta mal, para cambiarlo solo puedo hacerlo por sql.
Alguime me puede ayudar.
La constraint debe pasar de " CONSTRAINT nomina_mes_check CHECK (mes >= 1 AND mes <= 12)" a "CONSTRAINT nomina_mes_check CHECK (mes >= 0 AND mes <= 11)"
Gracias.