Skip to content
Snippets Groups Projects
Commit d5b9faa3 authored by Dapeng's avatar Dapeng
Browse files

extend the size of the description col for visit

parent bd5dd27f
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,6 @@ package org.springframework.samples.petclinic.model; ...@@ -17,8 +17,6 @@ package org.springframework.samples.petclinic.model;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
...@@ -27,6 +25,7 @@ import javax.persistence.ManyToOne; ...@@ -27,6 +25,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
...@@ -49,7 +48,7 @@ public class Visit extends BaseEntity { ...@@ -49,7 +48,7 @@ public class Visit extends BaseEntity {
/** /**
* Holds value of property description. * Holds value of property description.
*/ */
@NotEmpty @Size(max = 8192)
@Column(name = "description") @Column(name = "description")
private String description; private String description;
......
...@@ -58,7 +58,7 @@ CREATE TABLE visits ( ...@@ -58,7 +58,7 @@ CREATE TABLE visits (
id INTEGER IDENTITY PRIMARY KEY, id INTEGER IDENTITY PRIMARY KEY,
pet_id INTEGER NOT NULL, pet_id INTEGER NOT NULL,
visit_date DATE, visit_date DATE,
description VARCHAR(255) description VARCHAR(8192)
); );
ALTER TABLE visits ADD CONSTRAINT fk_visits_pets FOREIGN KEY (pet_id) REFERENCES pets (id); ALTER TABLE visits ADD CONSTRAINT fk_visits_pets FOREIGN KEY (pet_id) REFERENCES pets (id);
CREATE INDEX visits_pet_id ON visits (pet_id); CREATE INDEX visits_pet_id ON visits (pet_id);
...@@ -55,6 +55,6 @@ CREATE TABLE IF NOT EXISTS visits ( ...@@ -55,6 +55,6 @@ CREATE TABLE IF NOT EXISTS visits (
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
pet_id INT(4) UNSIGNED NOT NULL, pet_id INT(4) UNSIGNED NOT NULL,
visit_date DATE, visit_date DATE,
description VARCHAR(255), description VARCHAR(8192),
FOREIGN KEY (pet_id) REFERENCES pets(id) FOREIGN KEY (pet_id) REFERENCES pets(id)
) engine=InnoDB; ) engine=InnoDB;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment