I was trying to create a table on my MySQL-Workbench, but, everytime i try to execute this line under me, the code didn't execute. It's say that is a "Error Code : 3813 Column check constraint 'lancamento_chk_2' references other column".
create table lancamento
(
id bigint not null primary key auto_increment,
descricao varchar(100) not null,
mes integer not null,
ano integer not null,
valor numeric (16,2) not null,
tipo varchar(20) check( tipo in('RECEITA','DESPESA')) not null,
status_lanca varchar(20) check(tipo in ('PENDENTE','CANCELADO','EFETIVADO')) NOT NULL,
id_usuario bigint references usuarios(id) ,
data_cad_lanca date
);