Skip to content
Snippets Groups Projects
Commit 368f428e authored by Sarthak Shrivastava's avatar Sarthak Shrivastava
Browse files

changed category Greek Life to GreekLife to get the enum to work

parent 7b2724f9
No related branches found
No related tags found
No related merge requests found
...@@ -18,14 +18,14 @@ INSERT INTO USER (email, lname, fname, password, phone_number) VALUES ...@@ -18,14 +18,14 @@ INSERT INTO USER (email, lname, fname, password, phone_number) VALUES
SELECT * FROM USER; SELECT * FROM USER;
-- DELETE FROM USER; -- DELETE FROM USER;
DROP TABLE ORGANIZATION;
CREATE TABLE IF NOT EXISTS ORGANIZATION ( CREATE TABLE IF NOT EXISTS ORGANIZATION (
organization_id INT AUTO_INCREMENT, organization_id INT AUTO_INCREMENT,
name VARCHAR(256) NOT NULL, name VARCHAR(256) NOT NULL,
email VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL,
description VARCHAR(1024), description VARCHAR(1024),
owner_email VARCHAR(128) NOT NULL, owner_email VARCHAR(128) NOT NULL,
category ENUM('ACADEMIC', 'RECREATION', 'TECHNOLOGY', 'POLITICS', 'GREEK LIFE'), category ENUM('ACADEMIC', 'RECREATION', 'TECHNOLOGY', 'POLITICS', 'GREEKLIFE'),
member_count INT DEFAULT 1, member_count INT DEFAULT 1,
PRIMARY KEY (organization_id), PRIMARY KEY (organization_id),
CONSTRAINT fk_user_organization FOREIGN KEY (owner_email) REFERENCES USER (email) CONSTRAINT fk_user_organization FOREIGN KEY (owner_email) REFERENCES USER (email)
...@@ -36,7 +36,7 @@ INSERT INTO ORGANIZATION (name, email, description, owner_email, category, membe ...@@ -36,7 +36,7 @@ INSERT INTO ORGANIZATION (name, email, description, owner_email, category, membe
('Chess Society', 'chesssociety@example.com', 'Organization for chess lovers', 'alicedoe@example.com', 'RECREATION', 20), ('Chess Society', 'chesssociety@example.com', 'Organization for chess lovers', 'alicedoe@example.com', 'RECREATION', 20),
('Science Association', 'science@example.com', 'Encouraging scientific exploration', 'johnsmith@example.com', 'ACADEMIC', 30), ('Science Association', 'science@example.com', 'Encouraging scientific exploration', 'johnsmith@example.com', 'ACADEMIC', 30),
('Political Discussion Group', 'politics@example.com', 'Discussions on current political affairs', 'alicedoe@example.com', 'POLITICS', 25), ('Political Discussion Group', 'politics@example.com', 'Discussions on current political affairs', 'alicedoe@example.com', 'POLITICS', 25),
('Greek Life Association', 'greeklife@example.com', 'Promoting Greek culture and traditions', 'emilyjohnson@example.com', 'GREEK LIFE', 40); ('Greek Life Association', 'greeklife@example.com', 'Promoting Greek culture and traditions', 'emilyjohnson@example.com', 'GREEKLIFE', 40);
CREATE TABLE IF NOT EXISTS ORGANIZATION_ROSTER ( CREATE TABLE IF NOT EXISTS ORGANIZATION_ROSTER (
user_email VARCHAR(128) NOT NULL, user_email VARCHAR(128) NOT NULL,
......
...@@ -7,17 +7,19 @@ import jakarta.persistence.*; ...@@ -7,17 +7,19 @@ import jakarta.persistence.*;
@Table(name = "ORGANIZATION") @Table(name = "ORGANIZATION")
public class Organization { public class Organization {
// enum Category { enum Category {
// ACADEMIC, ACADEMIC,
// RECREATION, RECREATION,
// TECHNOLOGY, TECHNOLOGY,
// POLITICS, POLITICS,
// GREEKLIFE
// } GREEKLIFE
}
// private Category category; @Enumerated(EnumType.STRING)
private Category category;
private String category; // private String category;
private Integer memberCount; private Integer memberCount;
...@@ -37,11 +39,11 @@ public class Organization { ...@@ -37,11 +39,11 @@ public class Organization {
// this.category = category; // this.category = category;
// } // }
public String getCategory() { public Category getCategory() {
return category; return category;
} }
public void setCategory(String category) { public void setCategory(Category category) {
this.category = category; this.category = category;
} }
......
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