Skip to main content
Added semicolons to sql query
Source Link
Mon Calamari
  • 4.5k
  • 3
  • 28
  • 46

Biesior basically summed it up quite well. However, as a beginner in Play, I find that a bit more clarification with a concrete example might be helpful.

First, the following example is for Java.

Suppose you added a new field

public String dum_str;

in your model Dum. Then, you will need a 2.sql under conf/evolutions/ like this:

# --- !Ups
ALTER TABLE dum ADD COLUMN dum_str VARCHAR(255);

# --- !Downs
ALTER TABLE dum DROP dum_strdum_str;

I hope this would be helpful.

Biesior basically summed it up quite well. However, as a beginner in Play, I find that a bit more clarification with a concrete example might be helpful.

First, the following example is for Java.

Suppose you added a new field

public String dum_str;

in your model Dum. Then, you will need a 2.sql under conf/evolutions/ like this:

# --- !Ups
ALTER TABLE dum ADD COLUMN dum_str VARCHAR(255)

# --- !Downs
ALTER TABLE dum DROP dum_str

I hope this would be helpful.

Biesior basically summed it up quite well. However, as a beginner in Play, I find that a bit more clarification with a concrete example might be helpful.

First, the following example is for Java.

Suppose you added a new field

public String dum_str;

in your model Dum. Then, you will need a 2.sql under conf/evolutions/ like this:

# --- !Ups
ALTER TABLE dum ADD COLUMN dum_str VARCHAR(255);

# --- !Downs
ALTER TABLE dum DROP dum_str;

I hope this would be helpful.

Source Link
JBT
  • 8.8k
  • 21
  • 69
  • 107

Biesior basically summed it up quite well. However, as a beginner in Play, I find that a bit more clarification with a concrete example might be helpful.

First, the following example is for Java.

Suppose you added a new field

public String dum_str;

in your model Dum. Then, you will need a 2.sql under conf/evolutions/ like this:

# --- !Ups
ALTER TABLE dum ADD COLUMN dum_str VARCHAR(255)

# --- !Downs
ALTER TABLE dum DROP dum_str

I hope this would be helpful.