Bom dia a todos
Quando eu vou fazer o V4__create_table_resposta.sql tá dando um erro de sintaxe:
SQL State : 42001
Error Code : 42001
Message : Syntax error in SQL statement "create table resposta(\000a id bigint not null auto_increment,\000a mensagem varchar(300) not null,\000a data_criacao datetime not null,\000a topico_id bigint not null,\000a autor_id bigint not null,\000a solucao int[*](1) not null,\000a primary key(id),\000a foreign key(topico_id) references topico(id),\000a foreign key(autor_id) references usuario(id)\000a)"; expected "ARRAY, INVISIBLE, VISIBLE, NOT NULL, NULL, AS, DEFAULT, GENERATED, ON UPDATE, NOT NULL, NULL, AUTO_INCREMENT, DEFAULT ON NULL, NULL_TO_DEFAULT, SEQUENCE, SELECTIVITY, COMMENT, CONSTRAINT, COMMENT, PRIMARY KEY, UNIQUE, NOT NULL, NULL, CHECK, REFERENCES, AUTO_INCREMENT, ,, )"; SQL statement:
create table resposta(
//ocultado a tabela
) [42001-214]
Sendo que eu copie a tabela de forma identica:
create table resposta(
id bigint not null auto_increment,
mensagem varchar(300) not null,
data_criacao datetime not null,
topico_id bigint not null,
autor_id bigint not null,
solucao int(1) not null,
primary key(id),
foreign key(topico_id) references topico(id),
foreign key(autor_id) references usuario(id)
);
Meu arquivo topico original:
package br.com.alura.forum.modelo
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.ManyToOne
import java.time.LocalDateTime
@Entity
data class Resposta(
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long? = null,
val mensagem: String,
val dataCriacao: LocalDateTime = LocalDateTime.now(),
@ManyToOne
val autor: Usuario,
@ManyToOne
val topico: Topico,
val solucao: Boolean
)
Porque está acontencendo esse erro, sendo que eu copie de forma identica da aula, será que é a versão de alguma extensao, ou escrevi errado em outro lugar?
Ps: quando eu fui procurar o caractere 214 dá nesta linha:
foreign key(topico_id) references topico(id),