简体   繁体   中英

Cannot create new columns in database using @column

I'm working in a task that demands to create a new status to my class and so I need to insert a new column in the database table. I tried to use this in my TO file:

@Column(name="nameOfNewColumn")
private Boolean nameOfNewColumn;

I also included the set and get methods, but it just doesn't work, I open the table with Postgres and it doesn't appear. I reseted the server, reconnected the data base, but nothing happens. I'm using eclipse oxygen and PgAdmin 4.

I believe that it must be a simple problem, but I couldn't find anything on the web (maybe I don't know which words to use xD). I'd appreciate any kind of help! :)

Some data is missing - Do you use hibernate/ flyWay/ liquiBase ?

you can for example add

hibernate.hbm2ddl.auto=update

to adjust the schema automatically

(or the relevant syntax at flyWay (sql) / liquiBase (xml)) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM