So I have already created my database and all the tables with the appropriate columns in Mysql and connected it to springBoot. My issue is that when I create my user class which matches all the right columns on the Mysql setup I get: "Error executing DDL...[Table users already exists]" Here is my application.properties setup
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# Hibernate specific properties
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
spring.jpa.hibernate.ddl-auto=update
and my User class
import jakarta.persistence.*;
@Entity
@Table(name = "Users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private String firstName;
private String lastName;
private String password;
private Float rating;
// getters and setters
}
and my Users table in sql
CREATE TABLE Users (
User_ID INT AUTO_INCREMENT,
First_Name VARCHAR(100),
Last_Name VARCHAR(100),
Password VARCHAR(255), -- storing hashed password
Rating FLOAT,
PRIMARY KEY (User_ID)
);
Can someone guide me as to why this is happening?