--- /dev/null
+-- Gaslight Media Members Database
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 1.0.43
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Accommodation Types
+CREATE TABLE {prefix}accommodation_types (
+ id INT NOT NULL AUTO_INCREMENT,
+ facility_type INT NULL, -- See "Facility Types" in config/plugin.ini
+ name TINYTEXT NULL, -- Name of accommodation type
+ descr TEXT NULL, -- Description of accommodation type
+ short_descr TINYTEXT NULL, -- Short description of accommodation type
+ PRIMARY KEY (id),
+ INDEX(facility_type),
+ INDEX(name(20))
+);
+
+----
+
+-- Accommodations
+CREATE TABLE {prefix}accommodations (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- Accommodation record is active flag
+ name TINYTEXT NULL, -- Name of the accommodation record
+ accommodation_type INT NULL, -- Pointer to Accommodation type in accommodation_types table
+ descr TEXT NULL, -- Description of accommodation
+ short_descr TINYTEXT NULL, -- Short description of accommodation
+ url TINYTEXT NULL, -- URL for info regarding this accommodation
+ notes TEXT NULL, -- Notes regarding this accommodation - Not displayed on front-end
+ create_time TIMESTAMP NULL, -- Date/time this accommondation was created
+ modify_time TIMESTAMP NULL, -- Date/time this accommodation was last updated
+ quant INT NULL, -- Quantity of this accommodation
+ reservation_url TINYTEXT NULL, -- URL to use for making reservaionn
+ reservation_id TINYTEXT NULL, -- ID to use as a reference to this accommodation when making reservations
+ year_round TINYINT(1) NULL, -- Accommodation is available year-round
+ ref_type INT NULL, -- Type of entity this accommodation is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this accommodation is associated with
+ PRIMARY KEY (id),
+ INDEX(accommodation_type),
+ INDEX(name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Accounts
+CREATE TABLE {prefix}accounts (
+ id INT NOT NULL AUTO_INCREMENT,
+ member INT NULL,
+ payment_type INT NULL,
+ invoice_delivery INT NULL,
+ PRIMARY KEY (id),
+ INDEX(member)
+);
+
+----
+
+-- Activities
+CREATE TABLE {prefix}activities (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- Activity is active flag
+ activity_type INT NULL, -- ***** NEED TO ADD ACTIVITY_TYPES TABLE AND SUPPORT FOR THAT *****
+ name TINYTEXT NULL, -- Activity name
+ descr TEXT NULL, -- Description of activity
+ short_descr TINYTEXT NULL, -- Shot description of activity
+ phone TINYTEXT NULL, -- Phone number to contact someone regarding this activity
+ url TINYTEXT NULL, -- URL for info regarding this activity
+ notes TEXT NULL, -- Notes regarding this activity - Not displayed on front-end
+ create_time TIMESTAMP NULL, -- Date/time this activity was created
+ modify_time TIMESTAMP NULL, -- Date/time this activity was last updated
+ ref_type INT NULL, -- Type of entity this activity is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of type ref_type
+ PRIMARY KEY (id),
+ INDEX(activity_type),
+ INDEX(name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Amenities
+CREATE TABLE {prefix}amenities (
+ id INT NOT NULL AUTO_INCREMENT,
+ active TINYINT(1) NULL, -- Amenity is active flag
+ name TINYTEXT NULL, -- Name of amenity
+ descr TEXT NULL, -- Description of amenity
+ short_descr TINYTEXT NULL, -- Short description of amenity
+ ref_type INT NULL, -- Type of entity these amenitites are associated with - see plugin.ini ref_type tables
+ uses_value BOOLEAN NULL, -- Flag indicating whether the amenity requires a quantity number
+ PRIMARY KEY (id),
+ INDEX(name(20))
+);
+
+----
+
+-- Amenity Reference - Links a specific amenity to a specific entity of type ref_type
+CREATE TABLE {prefix}amenity_ref (
+ id INT NOT NULL AUTO_INCREMENT,
+ amenity INT NULL, -- Pointer to amenity in amenities table
+ ref_type INT NULL, -- Copy of ref_type from matching ameities table entry - to simplify searches
+ ref_dest INT NULL, -- Pointer to the specific entity of type ref_type
+ amenity_value TINYTEXT NULL, -- Quanity if amenity uses values
+ PRIMARY KEY (id),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Member Cateogries - used with member information records
+CREATE TABLE {prefix}categories (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of this category
+ descr TEXT NULL, -- Description of this category
+ short_descr TINYTEXT NULL, -- Short description of this category
+ parent INT NULL, -- Pointer to parent category in this table - if there is one
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Mapping of categories to speific member information records
+CREATE TABLE {prefix}category_member_info (
+ id INT NOT NULL AUTO_INCREMENT,
+ category INT NULL, -- Pointer to category in categories table
+ member_info INT NULL, -- Pointer to member infomation record
+ PRIMARY KEY (id),
+ CONSTRAINT {prefix}categories_fk_1
+ FOREIGN KEY (category)
+ REFERENCES {prefix}categories (id)
+ ON DELETE CASCADE,
+ INDEX(category),
+ INDEX(member_info)
+);
+
+----
+
+-- Cities
+CREATE TABLE {prefix}cities (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of city
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Contacts - used by various entities
+CREATE TABLE {prefix}contacts (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- Contact is active flag
+ fname TINYTEXT NULL, -- First name of contact
+ lname TINYTEXT NULL, -- Last name of contact
+ contact_type INT NULL, -- Contact type - see contact_type table (individual, role, ...)
+ org TINYTEXT NULL, -- Organization name
+ addr1 TINYTEXT NULL, -- Address line 1 - Address is for contact, not necessarily for organization
+ addr2 TINYTEXT NULL, -- Address line 2
+ city INT NULL, -- Pointer to city in cities table
+ state TINYTEXT NULL, -- Two character state code - matches states.ini entries
+ country TINYTEXT NULL, -- Two character country code - matches countries.ini entries
+ zip TINYTEXT NULL, -- ZIP/Postal Code
+ lat FLOAT NULL, -- Latitude of contact location
+ lon FLOAT NULL, -- Longitude of contact location
+ url TINYTEXT NULL, -- URL to information regarding this contact
+ office_phone TINYTEXT NULL, -- Office phone number
+ home_phone TINYTEXT NULL, -- Home phone number - or after-hours phone number
+ mobile_phone TINYTEXT NULL, -- Mobile phone number
+ alt_phone TINYTEXT NULL, -- An alternate phone number
+ fax TINYTEXT NULL, -- FAX number (do people still use these?)
+ email TINYTEXT NULL, -- E-Mail address
+ alt_email TINYTEXT NULL, -- Alternate E-Mail address - Also used to log-in
+ username TINYTEXT NULL, -- Optional username to use for login
+ password TINYTEXT NULL, -- Encrypted password
+ notes TEXT NULL, -- Notes - Not displayed on front-end
+ create_time TIMESTAMP NULL, -- Create date/time
+ modify_time TIMESTAMP NULL, -- Last modified date/time
+ ref_type INT NULL, -- Type of entity this contact is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this contact is associated with
+ PRIMARY KEY (id),
+ INDEX(fname(20)),
+ INDEX(lname(20)),
+ INDEX(city),
+ INDEX(zip(10)),
+ INDEX(lat),
+ INDEX(lon),
+ INDEX(email(20))
+);
+
+----
+
+-- Mapping of permissions to specific contacts
+CREATE TABLE {prefix}contact_permissions (
+ id INT NOT NULL AUTO_INCREMENT,
+ permission INT NULL, -- Index of permission - see permissions table in plugin.ini
+ contact INT NULL, -- Pointer to specific contact
+ PRIMARY KEY (id),
+ CONSTRAINT {prefix}contact_fk_1
+ FOREIGN KEY (contact)
+ REFERENCES {prefix}contacts (id)
+ ON DELETE CASCADE,
+ INDEX(permission),
+ INDEX(contact)
+);
+
+
+----
+
+-- Facilities - Facilities are separate functional units of a member, either physically or operationally
+-- For example, separate facilities could be individual properties (hotels, motels) or could be operationally
+-- separate hotel and restaurant at the same location. A facility is an entity under a member "location".
+CREATE TABLE {prefix}facilities (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- Facility is active flag
+ facility_type INT NULL, -- Facility type - see plugin.ini facility type
+ location INT NULL, -- Pointer to one of the member's locations - see locations table
+ name TINYTEXT NULL, -- Name of this facility
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short description
+ addr1 TINYTEXT NULL, -- Address line 1
+ addr2 TINYTEXT NULL, -- Address line 2
+ city INT NULL, -- Pointer to city in cities table
+ state TINYTEXT NULL, -- Two character state code - matches states.ini entries
+ country TINYTEXT NULL, -- Two character country code - matches countries.ini entries
+ zip TINYTEXT NULL, -- ZIP/Postal code
+ lat FLOAT NULL, -- Latitude of facility
+ lon FLOAT NULL, -- Longitude of facility
+ phone TINYTEXT NULL, -- Primary phone number
+ toll_free TINYTEXT NULL, -- Toll Free phone number
+ url TINYTEXT NULL, -- URL for information specifically regarding this facility
+ logo TINYTEXT NULL, -- Logo
+ notes TEXT NULL, -- Notes - Not displayed on front-end
+ create_time TIMESTAMP NULL, -- Create date/time
+ modify_time TIMESTAMP NULL, -- Last modified date/time
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(city),
+ INDEX(zip(10)),
+ INDEX(lat),
+ INDEX(lon)
+);
+
+----
+
+-- Donwloadable Files - files are stored under /wp-content/uploads/glm-member-db/files/
+CREATE TABLE {prefix}files (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of this file
+ file_name TINYTEXT NULL, -- Physical file name for this file
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short descroption
+ size INT NULL, -- Download size of this file
+ pending BOOLEAN NULL, -- File is pending review flag
+ create_date DATE NULL, -- Date file was uploaded
+ ref_type INT NULL, -- Type of entity this file is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this file is associated with
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(file_name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Detail on golf courses
+CREATE TABLE {prefix}golf (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- This golf course is active flag
+ name TINYTEXT NULL, -- Name of Golf course
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short Description
+ rating TINYTEXT NULL, -- Rating
+ par TINYTEXT NULL, -- Par
+ yardage TINYTEXT NULL, -- Total yardage
+ slope TINYTEXT NULL, -- Slope rating
+ walking TINYINT(1) NULL, -- Walking course
+ holes INT NULL, -- Number of holes
+ reservation_url TINYTEXT NULL, -- URL for making reservations for this course
+ ref_type INT NULL, -- Type of entity this golf course is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this golf course is associated with
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Images - Images are stored under /wp-content/uploads/glm-member-db/images/{size}/
+CREATE TABLE {prefix}images (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Original name of the image - might be URL if copied via HTTP
+ status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table
+ file_name TINYTEXT NULL, -- Stored file name for the image
+ descr TEXT NULL, -- Description
+ caption TINYTEXT NULL, -- Caption for the image
+ position INT NULL, -- Numeric position for sequence of display
+ ref_type INT NULL, -- Type of entity this image is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(file_name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- Member locations - Locations are physically separate campuses where facilities exist
+CREATE TABLE {prefix}locations (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- This location is active flag
+ member INT NULL, -- Pointer to main member record
+ member_info INT NULL, -- Pointer to associated member info record
+ name TINYTEXT NULL, -- Name of location
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short Description
+ addr1 TINYTEXT NULL, -- Address line 1 - Main address for this location
+ addr2 TINYTEXT NULL, -- Address line 2
+ city INT NULL, -- Pointer to city in cities table
+ state TINYTEXT NULL, -- Two character state code - matches states.ini entries
+ country TINYTEXT NULL, -- Two character country code - matches countries.ini entries
+ zip TINYTEXT NULL, -- ZIP/Postal code
+ lat FLOAT NULL, -- Latitude of location
+ lon FLOAT NULL, -- Longitude of location
+ region INT NULL, -- Pointer to region where location exists
+ phone TINYTEXT NULL, -- Primary phone number
+ toll_free TINYTEXT NULL, -- Toll Free phone number
+ url TINYTEXT NULL, -- URL for information regarding this location
+ logo TINYTEXT NULL, -- Logo
+ notes TEXT NULL, -- Notes - not displayed on front-end
+ create_time TIMESTAMP NULL, -- Create date/time
+ modify_time TIMESTAMP NULL, -- Last Update date/time
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(city),
+ INDEX(zip(10)),
+ INDEX(lat),
+ INDEX(lon),
+ INDEX(region)
+);
+
+----
+
+-- Meals offered by a restaurant
+CREATE TABLE {prefix}meals (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- Meal is active flag
+ name TINYTEXT NULL, -- Name of this meal (typically Breakfast, Lunch, Dinner, Brunch, ...)
+ descr TEXT NULL, -- Description of the meal
+ short_descr TINYTEXT NULL, -- Short description
+ menu TEXT NULL, -- Text menu for this meal
+ menu_file TINYTEXT NULL, -- File name of downloadable menu file (PDF, etc.)
+ daily BOOLEAN NULL, -- Flag indicating if meal is available daily
+ daily_start_time TIME NULL, -- Daily meal - Time of day this meal starts
+ daily_end_time TIME NULL, -- Daily meal - Time of day this meal ends
+ daily_res_req BOOLEAN NULL, -- Daily meal - Reservations requested
+ sunday BOOLEAN NULL, -- Flag indicating if meal is available Sunday
+ sun_menu TEXT NULL, -- Optional menu text for Sunday
+ sun_start_time TIME NULL, -- Sunday - Time of day this meal starts
+ sun_end_time TIME NULL, -- Sunday - Time of day this meal ends
+ sun_res_req BOOLEAN NULL, -- Sunday - Reservations requested
+ monday BOOLEAN NULL, -- Flag indicating if meal is available Monday
+ mon_menu TEXT NULL, -- Optional menu text for Monday
+ mon_start_time TIME NULL, -- Monday - Time of day this meal starts
+ mon_end_time TIME NULL, -- Monday - Time of day this meal ends
+ mon_res_req BOOLEAN NULL, -- Monday - Reservations requested
+ tuesday BOOLEAN NULL, -- Flag indicating if meal is available Tuesday
+ tue_menu TEXT NULL, -- Optional menu text for Tuesday
+ tue_start_time TIME NULL, -- Tuesday - Time of day this meal starts
+ tue_end_time TIME NULL, -- Tuesday - Time of day this meal ends
+ tue_res_req BOOLEAN NULL, -- Tuesday - Reservations requested
+ wednesday BOOLEAN NULL, -- Flag indicating if meal is available Wednesday
+ wed_menu TEXT NULL, -- Optional menu text for Wednesday
+ wed_start_time TIME NULL, -- Wednesday - Time of day this meal starts
+ wed_end_time TIME NULL, -- Wednesday - Time of day this meal ends
+ wed_res_req BOOLEAN NULL, -- Wednesday - Reservations requested
+ thursday BOOLEAN NULL, -- Flag indicating if meal is available Thursday
+ thu_menu TEXT NULL, -- Optional menu text for Thursday
+ thu_start_time TIME NULL, -- Thursday - Time of day this meal starts
+ thu_end_time TIME NULL, -- Thursday - Time of day this meal ends
+ thu_res_req BOOLEAN NULL, -- Thursday - Reservations requested
+ friday BOOLEAN NULL, -- Flag indicating if meal is available Friday
+ fri_menu TEXT NULL, -- Optional menu text for Friday
+ fri_start_time TIME NULL, -- Friday - Time of day this meal starts
+ fri_end_time TIME NULL, -- Friday - Time of day this meal ends
+ fri_res_req BOOLEAN NULL, -- Friday - Reservations requested
+ saturday BOOLEAN NULL, -- Flag indicating if meal is available Saturday
+ sat_menu TEXT NULL, -- Optional menu text for Saturday
+ sat_start_time TIME NULL, -- Saturday - Time of day this meal starts
+ sat_end_time TIME NULL, -- Saturday - Time of day this meal ends
+ sat_res_req BOOLEAN NULL, -- Saturday - Reservations requested
+ restaurant INT NULL, -- Pointer to restaurant that has this meal
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(restaurant)
+);
+
+----
+
+-- Primary member records - One for each member
+CREATE TABLE {prefix}members (
+ id INT NOT NULL AUTO_INCREMENT,
+ access INT NULL, -- Access type - See memb_access table in plugin.ini
+ member_type INT NULL, -- Pointer to member type in member_type table
+ created DATE NULL, -- Date member record was created
+ name TINYTEXT NULL, -- Member name
+ member_slug TINYTEXT NULL, -- Member name slug for canonical URLs (lowercase, "-" for spaces, no punctuation)
+ PRIMARY KEY (id),
+ INDEX(name(20)),
+ INDEX(member_slug(20)),
+ INDEX(created)
+);
+
+----
+
+-- Member information version record - May be multiples per member - Only one with stauts "Active" for a distinct date range
+CREATE TABLE {prefix}member_info (
+ id INT NOT NULL AUTO_INCREMENT,
+ member INT NULL, -- Pointer to member record in table members
+ member_name TINYTEXT NULL, -- Copy of member name from members table entry for fast reference
+ status INT NULL, -- Status of this member information record - See plugin.ini status table
+ reference_name TINYTEXT NULL, -- Refernce name for this member information record - Not displayed on front-end
+ descr TEXT NULL, -- Description
+ short_descr TEXT NULL, -- Short description
+ addr1 TINYTEXT NULL, -- Address line 1 - Main member address (main location) or
+ addr2 TINYTEXT NULL, -- Address line 2
+ city INT NULL, -- Pointer to City in cities table
+ state TINYTEXT NULL, -- Two character state code - matches states.ini entries
+ country TINYTEXT NULL, -- Two character country code - matches countries.ini entries
+ zip TINYTEXT NULL, -- ZIP/Postal code
+ lat FLOAT NULL, -- Latitude of member's location
+ lon FLOAT NULL, -- Longitude of member's location
+ region INT NULL, -- Pointer to entry in regions table
+ phone TINYTEXT NULL, -- Primary phone number
+ toll_free TINYTEXT NULL, -- Toll Free phone number
+ url TINYTEXT NULL, -- URL with information about this member
+ email TINYTEXT NULL, -- Main E-Mail address for this member
+ logo TINYTEXT NULL, -- Member logo
+ cc_type INT NULL, -- Bitmap of credit card types accepted - See credit_card array in plugin.ini
+ notes TEXT NULL, -- General notes - Not displayed in front-end
+ create_time TIMESTAMP NULL, -- Create date/time
+ modify_time TIMESTAMP NULL, -- Last update date/time
+ PRIMARY KEY (id),
+ INDEX(status),
+ INDEX(city),
+ INDEX(zip(10)),
+ INDEX(lat),
+ INDEX(lon),
+ INDEX(region)
+);
+
+----
+
+-- Member type - Can be used to assign members to different "classes" of membership (i.e. Full, Associate, Premium)
+-- Mostly for internal use by the member organization, but could be displayed - Consider a short_description if they are.
+CREATE TABLE {prefix}member_type (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of member type
+ descr TINYTEXT NULL, -- Description of member type
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Regions - Used to segment members into various geographical regions - can be cities, counties, or other logical regions
+CREATE TABLE {prefix}regions (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of region
+ descr TEXT NULL, -- Descrption of region
+ short_descr TINYTEXT NULL, -- Short descroption of region
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Resturaunt Types - Various general types of restaurants (i.e. Fast Food, Ethnic, Fine food, ...)
+CREATE TABLE {prefix}restaurant_types (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of restaurant type
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short Description
+ PRIMARY KEY (id),
+ INDEX(name(20))
+);
+
+----
+
+-- Restaurants
+CREATE TABLE {prefix}restaurants (
+ id INT NOT NULL AUTO_INCREMENT,
+ active BOOLEAN NULL, -- This restaurant is active flag
+ name TINYTEXT NULL, -- Name of restaurant
+ restaurant_type INT NULL, -- Pointer to restaurant_types table entry
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short Description
+ url TINYTEXT NULL, -- URL of Web page about this restaurant
+ reservation_url TINYTEXT NULL, -- Reservations URL
+ phone TINYTEXT NULL, -- Phone number / reservations number
+ hours_descr TINYTEXT NULL, -- Description of restaurant hours
+ alcohol BOOLEAN NULL, -- Flag indicating whether restaurant serves alcohol
+ non_smoking BOOLEAN NULL, -- Flag indicating whether restaurant is non-smoking only
+ notes TEXT NULL, -- General notes
+ ref_type INT NULL, -- Type of entity this restaurant is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type this restaurant is associated with
+ PRIMARY KEY (id),
+ INDEX(restaurant_type),
+ INDEX(name(20)),
+ INDEX(ref_type),
+ INDEX(ref_dest)
+);
+
+----
+
+-- General settings available on Management page in admin - Only 1 entry in this table
+-- Items in this table should be all self-explanatory
+CREATE TABLE {prefix}settings_general (
+ id INT NOT NULL AUTO_INCREMENT,
+ admin_debug BOOLEAN DEFAULT '1',
+ admin_debug_verbose BOOLEAN DEFAULT '0',
+ front_debug BOOLEAN DEFAULT '0',
+ front_debug_verbose BOOLEAN DEFAULT '0',
+ google_maps_api_key TINYTEXT DEFAULT '',
+ maps_default_lat FLOAT DEFAULT '45.3749',
+ maps_default_lon FLOAT DEFAULT '-84.9592',
+ maps_default_zoom INTEGER DEFAULT '10',
+ time_zone TINYTEXT DEFAULT NULL,
+ canonical_member_page TINYTEXT DEFAULT NULL,
+ list_show_map BOOLEAN DEFAULT '1',
+ list_show_list BOOLEAN DEFAULT '1',
+ list_show_search BOOLEAN DEFAULT '1',
+ list_show_search_text BOOLEAN DEFAULT '1',
+ list_show_search_category BOOLEAN DEFAULT '1',
+ list_show_search_amenities BOOLEAN DEFAULT '1',
+ list_show_search_alpha BOOLEAN DEFAULT '1',
+ list_show_detail_link BOOLEAN DEFAULT '1',
+ list_show_logo BOOLEAN DEFAULT '1',
+ list_logo_size TINYTEXT NULL,
+ list_show_address BOOLEAN DEFAULT '1',
+ list_show_street BOOLEAN DEFAULT '1',
+ list_show_citystatezip BOOLEAN DEFAULT '1',
+ list_show_country BOOLEAN DEFAULT '1',
+ list_show_region BOOLEAN DEFAULT '1',
+ list_show_descr BOOLEAN DEFAULT '0',
+ list_show_short_descr BOOLEAN DEFAULT '1',
+ list_show_phone BOOLEAN DEFAULT '1',
+ list_show_tollfree BOOLEAN DEFAULT '1',
+ list_show_url BOOLEAN DEFAULT '1',
+ list_show_url_newtarget BOOLEAN DEFAULT '1',
+ list_show_email BOOLEAN DEFAULT '1',
+ list_show_categories BOOLEAN DEFAULT '1',
+ list_show_creditcards BOOLEAN DEFAULT '1',
+ list_show_amenities BOOLEAN DEFAULT '0',
+ list_map_show_detaillink BOOLEAN DEFAULT '1',
+ list_map_show_logo BOOLEAN DEFAULT '0',
+ list_map_logo_size TINYTEXT NULL,
+ list_map_show_descr BOOLEAN DEFAULT '0',
+ list_map_show_short_descr BOOLEAN DEFAULT '1',
+ list_map_show_address BOOLEAN DEFAULT '1',
+ list_map_show_street BOOLEAN DEFAULT '1',
+ list_map_show_citystatezip BOOLEAN DEFAULT '1',
+ list_map_show_country BOOLEAN DEFAULT '1',
+ list_map_show_region BOOLEAN DEFAULT '1',
+ list_map_show_phone BOOLEAN DEFAULT '1',
+ list_map_show_tollfree BOOLEAN DEFAULT '1',
+ list_map_show_url BOOLEAN DEFAULT '1',
+ list_map_show_url_newtarget BOOLEAN DEFAULT '1',
+ list_map_show_email BOOLEAN DEFAULT '1',
+ list_map_show_categories BOOLEAN DEFAULT '0',
+ list_map_show_creditcards BOOLEAN DEFAULT '0',
+ list_map_show_amenities BOOLEAN DEFAULT '0',
+ detail_show_map BOOLEAN DEFAULT '1',
+ detail_show_directions BOOLEAN DEFAULT '1',
+ detail_show_logo BOOLEAN DEFAULT '1',
+ detail_logo_size TINYTEXT NULL,
+ detail_show_descr BOOLEAN DEFAULT '1',
+ detail_show_short_descr BOOLEAN DEFAULT '0',
+ detail_show_address BOOLEAN DEFAULT '1',
+ detail_show_street BOOLEAN DEFAULT '1',
+ detail_show_citystatezip BOOLEAN DEFAULT '1',
+ detail_show_country BOOLEAN DEFAULT '1',
+ detail_show_region BOOLEAN DEFAULT '1',
+ detail_show_phone BOOLEAN DEFAULT '1',
+ detail_show_tollfree BOOLEAN DEFAULT '1',
+ detail_show_url BOOLEAN DEFAULT '1',
+ detail_show_url_newtarget BOOLEAN DEFAULT '1',
+ detail_show_email BOOLEAN DEFAULT '1',
+ detail_show_categories BOOLEAN DEFAULT '1',
+ detail_show_creditcards BOOLEAN DEFAULT '1',
+ detail_show_amenities BOOLEAN DEFAULT '1',
+ detail_show_imagegallery BOOLEAN DEFAULT '1',
+ detail_show_coupons BOOLEAN DEFAULT '0',
+ detail_show_packages BOOLEAN DEFAULT '0',
+ detail_map_show_logo BOOLEAN DEFAULT '0',
+ detail_map_logo_size TINYTEXT NULL,
+ detail_map_show_descr BOOLEAN DEFAULT '0',
+ detail_map_show_short_descr BOOLEAN DEFAULT '1',
+ detail_map_show_address BOOLEAN DEFAULT '1',
+ detail_map_show_street BOOLEAN DEFAULT '1',
+ detail_map_show_citystatezip BOOLEAN DEFAULT '1',
+ detail_map_show_country BOOLEAN DEFAULT '1',
+ detail_map_show_region BOOLEAN DEFAULT '1',
+ detail_map_show_phone BOOLEAN DEFAULT '1',
+ detail_map_show_tollfree BOOLEAN DEFAULT '1',
+ detail_map_show_url BOOLEAN DEFAULT '1',
+ detail_map_show_url_newtarget BOOLEAN DEFAULT '1',
+ detail_map_show_email BOOLEAN DEFAULT '1',
+ detail_map_show_categories BOOLEAN DEFAULT '0',
+ detail_map_show_creditcards BOOLEAN DEFAULT '0',
+ detail_map_show_amenities BOOLEAN DEFAULT '0',
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Set default entry
+INSERT INTO {prefix}settings_general
+ ( id, time_zone, canonical_member_page )
+ VALUES
+ ( 1, 'America/Detroit', 'member-detail' )
+;
+
+----
+
+-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
+-- Tems in this table should be all self-explanatory
+CREATE TABLE {prefix}settings_terms (
+ id INT NOT NULL AUTO_INCREMENT,
+ term_admin_menu_members TINYTEXT NULL,
+ term_admin_menu_member_list TINYTEXT NULL,
+ term_admin_menu_member TINYTEXT NULL,
+ term_admin_menu_configure TINYTEXT NULL,
+ term_admin_menu_settings TINYTEXT NULL,
+ term_admin_menu_shortcodes TINYTEXT NULL,
+ term_admin_menu_members_dashboard TINYTEXT NULL,
+ term_admin_menu_members_list TINYTEXT NULL,
+ term_admin_menu_members_reports TINYTEXT NULL,
+ term_admin_menu_member_dashboard TINYTEXT NULL,
+ term_admin_menu_member_info TINYTEXT NULL,
+ term_admin_menu_member_locations TINYTEXT NULL,
+ term_admin_menu_member_facilities TINYTEXT NULL,
+ term_admin_menu_member_attractions TINYTEXT NULL,
+ term_admin_menu_member_contacts TINYTEXT NULL,
+ term_admin_menu_configure_member_types TINYTEXT NULL,
+ term_admin_menu_configure_member_cats TINYTEXT NULL,
+ term_admin_menu_configure_accom_types TINYTEXT NULL,
+ term_admin_menu_configure_amenities TINYTEXT NULL,
+ term_admin_menu_configure_cities TINYTEXT NULL,
+ term_admin_menu_configure_regions TINYTEXT NULL,
+ term_admin_menu_settings_general TINYTEXT NULL,
+ term_admin_menu_settings_terms TINYTEXT NULL,
+ term_admin_menu_settings_development TINYTEXT NULL,
+ term_member TINYTEXT NULL,
+ term_member_cap TINYTEXT NULL,
+ term_member_plur TINYTEXT NULL,
+ term_member_plur_cap TINYTEXT NULL,
+ term_location TINYTEXT NULL,
+ term_location_cap TINYTEXT NULL,
+ term_location_plur TINYTEXT NULL,
+ term_location_plur_cap TINYTEXT NULL,
+ term_facility TINYTEXT NULL,
+ term_facility_cap TINYTEXT NULL,
+ term_facility_plur TINYTEXT NULL,
+ term_facility_plur_cap TINYTEXT NULL,
+ term_attraction TINYTEXT NULL,
+ term_attraction_cap TINYTEXT NULL,
+ term_attraction_plur TINYTEXT NULL,
+ term_attraction_plur_cap TINYTEXT NULL,
+ term_contact TINYTEXT NULL,
+ term_contact_cap TINYTEXT NULL,
+ term_contact_plur TINYTEXT NULL,
+ term_contact_plur_cap TINYTEXT NULL,
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Default terms entry
+INSERT INTO {prefix}settings_terms
+ (
+ id,
+ term_admin_menu_members,
+ term_admin_menu_member_list,
+ term_admin_menu_member,
+ term_admin_menu_configure,
+ term_admin_menu_settings,
+ term_admin_menu_shortcodes,
+ term_admin_menu_members_dashboard,
+ term_admin_menu_members_list,
+ term_admin_menu_members_reports,
+ term_admin_menu_member_dashboard,
+ term_admin_menu_member_info,
+ term_admin_menu_member_locations,
+ term_admin_menu_member_facilities,
+ term_admin_menu_member_attractions,
+ term_admin_menu_member_contacts,
+ term_admin_menu_configure_member_types,
+ term_admin_menu_configure_member_cats,
+ term_admin_menu_configure_accom_types,
+ term_admin_menu_configure_amenities,
+ term_admin_menu_configure_cities,
+ term_admin_menu_configure_regions,
+ term_admin_menu_settings_general,
+ term_admin_menu_settings_terms,
+ term_admin_menu_settings_development,
+ term_member,
+ term_member_cap,
+ term_member_plur,
+ term_member_plur_cap,
+ term_location,
+ term_location_cap,
+ term_location_plur,
+ term_location_plur_cap,
+ term_facility,
+ term_facility_cap,
+ term_facility_plur,
+ term_facility_plur_cap,
+ term_attraction,
+ term_attraction_cap,
+ term_attraction_plur,
+ term_attraction_plur_cap,
+ term_contact,
+ term_contact_cap,
+ term_contact_plur,
+ term_contact_plur_cap
+ )
+ VALUES
+ (
+ 1,
+ 'Members',
+ 'Member',
+ 'Add Member',
+ 'Configure',
+ 'Management',
+ 'Shortcodes',
+ 'Dashboard',
+ 'Member List',
+ 'Reports',
+ 'Member Dashboard',
+ 'Member Info',
+ 'Locations',
+ 'Facilities',
+ 'Attractions',
+ 'Contacts',
+ 'Member Types',
+ 'Member Categories',
+ 'Accommodation Types',
+ 'Amenities',
+ 'Cities',
+ 'Regions',
+ 'General Settings',
+ 'Terms & Phrases',
+ 'Development',
+ 'member',
+ 'Member',
+ 'members',
+ 'Members',
+ 'location',
+ 'Location',
+ 'locations',
+ 'Locations',
+ 'facility',
+ 'Facility',
+ 'facilities',
+ 'Facilities',
+ 'attraction',
+ 'Attraction',
+ 'attractions',
+ 'Attractions',
+ 'contact',
+ 'Contact',
+ 'contacts',
+ 'Contacts'
+ )
+;
+
+----
+
+-- Social Media types (i.e. Facebook, Twitter, ...)
+CREATE TABLE {prefix}social_media (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Name of this social media service
+ descr TEXT NULL, -- Description
+ short_descr TINYTEXT NULL, -- Short Description
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Social media to entity cross-reference table
+CREATE TABLE {prefix}social_media_ref (
+ id INT NOT NULL AUTO_INCREMENT,
+ ref_type INT NULL, -- Type of entity this entry is associated with
+ ref_dest INT NULL, -- Pointer to the specific entity of ref_type
+ social_media INT NULL, -- Pointer to entry in social_media table
+ url TINYTEXT NULL, -- URL to this social media service
+ PRIMARY KEY (id),
+ INDEX(ref_type),
+ INDEX(ref_dest),
+ INDEX(social_media)
+);