# MySQL dump 8.16
#
# Host: localhost    Database: csse_club
#--------------------------------------------------------
# Server version	3.23.42

#
# Table structure for table 'degrees'
#

CREATE TABLE degrees (
  id int(11) NOT NULL auto_increment,
  name varchar(100) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

#
# Dumping data for table 'degrees'
#

INSERT INTO degrees VALUES (1,'Bachelor of Computer Science');
INSERT INTO degrees VALUES (2,'Bachelor of Software Engineering');

#
# Table structure for table 'event_types'
#

CREATE TABLE event_types (
  event_type_id int(11) NOT NULL auto_increment,
  type varchar(30) NOT NULL default '',
  PRIMARY KEY  (event_type_id),
  UNIQUE KEY type (type),
  UNIQUE KEY event_type_id (event_type_id)
) TYPE=MyISAM;

#
# Dumping data for table 'event_types'
#


#
# Table structure for table 'events'
#

CREATE TABLE events (
  event_id int(11) NOT NULL auto_increment,
  event_type_id int(11) NOT NULL default '0',
  name varchar(100) NOT NULL default '',
  description text,
  start_datetime datetime NOT NULL default '0000-00-00 00:00:00',
  end_datetime datetime NOT NULL default '0000-00-00 00:00:00',
  website varchar(255) default NULL,
  contact_member_id int(11) NOT NULL default '0',
  cost decimal(6,2) default NULL,
  PRIMARY KEY  (event_id),
  UNIQUE KEY event_id (event_id)
) TYPE=MyISAM;

#
# Dumping data for table 'events'
#


#
# Table structure for table 'events_signup'
#

CREATE TABLE events_signup (
  event_id int(11) NOT NULL default '0',
  member_id int(11) NOT NULL default '0',
  status_id int(11) default NULL
) TYPE=MyISAM;

#
# Dumping data for table 'events_signup'
#


#
# Table structure for table 'events_signup_status'
#

CREATE TABLE events_signup_status (
  event_id int(11) default NULL,
  status_id int(11) NOT NULL auto_increment,
  status varchar(30) NOT NULL default '',
  PRIMARY KEY  (status_id)
) TYPE=MyISAM;

#
# Dumping data for table 'events_signup_status'
#


#
# Table structure for table 'granted_permissions'
#

CREATE TABLE granted_permissions (
  granted_permissions_id int(11) NOT NULL default '0',
  permission_id int(11) NOT NULL default '0',
  granted tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (granted_permissions_id),
  UNIQUE KEY granted_permissions_id (granted_permissions_id)
) TYPE=MyISAM;

#
# Dumping data for table 'granted_permissions'
#


#
# Table structure for table 'granted_permissions_id'
#

CREATE TABLE granted_permissions_id (
  granted_permissions_id int(11) NOT NULL auto_increment,
  member_id int(11) default NULL,
  position_id int(11) default NULL,
  member_type_id int(11) default NULL,
  UNIQUE KEY member_type_id (member_type_id),
  UNIQUE KEY position_id (position_id),
  UNIQUE KEY member_id (member_id),
  UNIQUE KEY granted_permissions_id (granted_permissions_id)
) TYPE=MyISAM;

#
# Dumping data for table 'granted_permissions_id'
#


#
# Table structure for table 'member_types'
#

CREATE TABLE member_types (
  member_type_id int(11) NOT NULL default '0',
  name varchar(30) NOT NULL default '',
  description text,
  PRIMARY KEY  (member_type_id),
  UNIQUE KEY name (name),
  UNIQUE KEY member_type_id (member_type_id)
) TYPE=MyISAM;

#
# Dumping data for table 'member_types'
#

INSERT INTO member_types VALUES (1,'Normal Member','Paid Member');

#
# Table structure for table 'members'
#

CREATE TABLE members (
  member_id int(11) NOT NULL auto_increment,
  first_name varchar(25) NOT NULL default '',
  last_name varchar(30) NOT NULL default '',
  student_id varchar(15) default NULL,
  DOB date,
  sex char(1),
  address varchar(150) default NULL,
  email varchar(50) default NULL,
  phone_home varchar(20) default NULL,
  phone_mobile varchar(20) default NULL,
  degree_id int(11) default '0',
  degree_year int(1) default '1',
  member_type_id int(11) default '0',
  PRIMARY KEY  (member_id),
  UNIQUE KEY student_id (student_id)
) TYPE=MyISAM;

#
# Dumping data for table 'members'
#


#
# Table structure for table 'permissions'
#

CREATE TABLE permissions (
  permission_id int(11) NOT NULL auto_increment,
  name varchar(50) NOT NULL default '',
  default_grant tinyint(1) default '0',
  PRIMARY KEY  (permission_id),
  UNIQUE KEY name (name),
  UNIQUE KEY permission_id (permission_id)
) TYPE=MyISAM;

#
# Dumping data for table 'permissions'
#


#
# Table structure for table 'positions'
#

CREATE TABLE positions (
  member_id int(11) NOT NULL default '0',
  position_id int(11) NOT NULL auto_increment,
  description text,
  name varchar(20) default NULL,
  PRIMARY KEY  (position_id),
  UNIQUE KEY position_id (position_id)
) TYPE=MyISAM;

#
# Dumping data for table 'positions'
#


